-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
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
ES6 module export build issue 'return' outside of function in webpack@5.0.0-beta.22 #281
Comments
@coemans change |
@evilebottnawi thank you for the support and feedback. I did the change, the build code is successfully generated but still doesn't contain the export I expected. You can download the new demo.zip, run
Like you said, it is still under development, but I'd expect this to work. Do I have to wait the Webpack v5 release or is there still something wrong? |
It is under developers and do not implement fully, but your error is not related to module bundling, why you try to build |
I thought Webpack v5 would have ES modules output support so all exports from the source would be available from the builded code when (for example) // test/es6.test.js
import { assert } from 'chai';
import { Test } from '../src/test.js'; // source code with Test class export
describe('ES6 import with source', () => {
it('import is available', function () {
const test = new Test();
assert.isTrue(test.available);
});
}); // test/build.test.js
import { assert } from 'chai';
import { Test } from '../dist/test.js'; // builded code with Test class export assumption
describe('ES6 import with Webpack build', () => {
it('import is available', function () {
const test = new Test();
assert.isTrue(test.available);
});
}); Maybe I was confused by the comments in #2933. Is there now a possibility to build code with Webpack and have the exports available or will there be one in the future? |
We don't implement fully support ES modules, please be patient. It is only generate valid ES module syntax, but don't generate |
@evilebottnawi no pressure, i'll wait. Just thought I could already test the functionality in the v5 beta version based on your feedback in #2933 and wanted to report any potential issue. |
@coemans We will write about ES modules supporting in changelog when it was ready for tests in wild 👍 |
I look forward to, thanks! |
Expected Behavior
#2933 triggered me to test the new output.libraryTarget: 'module' feature but unfortunately without success.
Actual Behavior
When running
npm install
andnpm run build
the following error occurred:Code
How Do We Reproduce?
Download demo.zip, run
npm install
andnpm run build
.The text was updated successfully, but these errors were encountered: