We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
html-loader should process index.html and pass the embedded ES6 js script to babel loader.
index.html
Running npx webpack resp. npm run webpack returns this error:
npx webpack
npm run webpack
ERROR in ./src/html/index.html Module build failed (from ./node_modules/extract-loader/lib/extractLoader.js): C:\ ... \website\src\index.js:1 (function (exports, require, module, __filename, __dirname) { import { gsap } from 'gsap'; ^^^^^^ SyntaxError: Cannot use import statement outside a module ...
webpack.config.js and package.json
index.html:
<!DOCTYPE html> <html lang="en"> <head> ... </head> <body id="#body"> <script type="module" src="../index.js"></script> </body> </html>
index.js:
import { gsap } from 'gsap'; import fullpage from 'fullpage.js'; import $ from 'jquery'; var ...
File structure:
- src/ - html/ - index.html - index.js - dist/ - webpack.config.js - package.json
Then run npm run webpack
The text was updated successfully, but these errors were encountered:
Please create full reproducible test repo
Sorry, something went wrong.
Looks extract-loader is broken
extract-loader
Yes, broken extract-loader, please open an issue in extract-loader repo, we can't fix it on our side, sorry
For those who find this issue, here's a link to the related issue on extract-loader.
peerigon/extract-loader#79
No branches or pull requests
Expected Behavior
html-loader should process
index.html
and pass the embedded ES6 js script to babel loader.Actual Behavior
Running
npx webpack
resp.npm run webpack
returns this error:Code
webpack.config.js and package.json
index.html:
index.js:
How Do We Reproduce?
File structure:
Then run
npm run webpack
The text was updated successfully, but these errors were encountered: