-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
I can't figure out how to import modules from Webpack bundle.
Basically I have several libraries using AMD.
If I use import map
{
"imports": {
"jquery": "./jquery.js",
"somelib": "./somelib.js",
}
}
Then System.import("somelib")
works fine.
But if I bundle it with Webpack
module.exports = {
entry: [ "jquery.js", "somelib.js" ],
output: {
libraryTarget: "system",
filename: "bundle.js"
},
module: {
rules: [{
parser: {
amd: true,
commonjs: true,
system: false
}
}]
},
resolve: {
alias: {
"jquery": "jquery.js"
"somelib": "somelib.js"
}
}
};
Then System.import("somelib")
doesn't load it from Webpack bundle.
In generated bundle.js
there is
System.register([], function(__WEBPACK_DYNAMIC_EXPORT__) {
return {
execute: function() {
__WEBPACK_DYNAMIC_EXPORT__(
/******/ (function(modules) {
[...]
But looks like names aren't registered.
Note that I don't want to System.import("bundle")
but individual library, because whole bundle is already loaded by regular <script>
and I don't want to load that dynamically.
NBeing
Metadata
Metadata
Assignees
Labels
No labels