When i work with parcel index.html the resulting files and served page can assign to window object.
However if I use watch or build window object doesn't have any of the assigned properties.
{
"name": "cli",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"dev-serve": "parcel src/index.html -d build --no-cache",
"watch": "parcel watch src/index.html -d build --no-cache",
"build": "parcel build src/index.html -d build --no-minify --no-cache",
"start": "yarn build"
},
"devDependencies": {
"parcel-bundler": "^1.5.1",
"typescript": "^2.6.2"
}
}
watch and build should allow assigning to window object as `parcel index.html``
either with
foo should not be undefinedhelp should not be undefinedhelpts should not be undefinedwindow object doesn't get any of the assigned props.
either with
foo is undefinedhelp is undefinedhelpts is undefineddev-serve behaves correctly
I don't know about the implementation, but I just recommend they all behave as the dev-serve. If unwanted then dev serve should behave like watch and build and at least we could provide a flag (although that would be a feature request instead)
| Software | Version(s)
| Parcel | 1.5.1
| Node | 8.9.2
| Yarn | 1.2.1
| OS | Windows 10 Pro
This has nothing to do about window.
If you look t it, the js was not found.
Use this to generate files: parcel watch src/index.html -d build --public-url=./
Thanks for letting me know what the issue was niicojs, however I am filing a new bug because I don't think this is desired. https://github.com/parcel-bundler/parcel/issues/714
Most helpful comment
This has nothing to do about
window.If you look t it, the js was not found.
Use this to generate files:
parcel watch src/index.html -d build --public-url=./