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
extract-loader should correctly process ES6 files and their links passed to it by html-loader.
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:
Created a small example application that produces a similar error.
https://glitch.com/edit/#!/melted-bitter-music
Sorry, something went wrong.
add failing test cases for extracting scripts from html entry points
6205e48
fails to extract scripts for html entry points raises an exception when those scripts are ES modules pertains to peerigon#79
No branches or pull requests
Expected Behavior
extract-loader should correctly process ES6 files and their links passed to it by html-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: