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
code:
class Home{ append() { this.getComponent().then((component) => { document.body.appendChild(component); }) } getComponent() { return import(/* webpackChunkName: "lodash" */ 'lodash/join').then(join => { let element = document.createElement('div'); element.innerHTML = join(['Hello', 'webpack'], ' '); return element; }) } } var myHome = new Home() myHome.append()
webpack code-splitting guides: https://webpack.js.org/guides/code-splitting/
The text was updated successfully, but these errors were encountered:
I advise taking a look at one of our execution tests that uses this approach: https://github.com/TypeStrong/ts-loader/tree/master/test/execution-tests/2.4.1_babel-importCodeSplitting
Sorry, something went wrong.
@johnnyreilly: the question was about using webpackChunkName in a typescriypt project
Oh well - that's simple. It should just work. Just make sure your tsconfig.json doesn't trim comments.
tsconfig.json
module: "esnext" and removeComments: false at tsconfig.json
No branches or pull requests
code:
webpack code-splitting guides: https://webpack.js.org/guides/code-splitting/
The text was updated successfully, but these errors were encountered: