Created
May 12, 2017 23:42
-
-
Save jhnns/2ec8461a9f4dfa9f18031b9d64b844b8 to your computer and use it in GitHub Desktop.
Dynamic modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = options => ({ | |
cacheable: true, | |
code: "console.log('Hello')" | |
}}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: "dynamic", | |
output: { | |
filename: "bundle.js" | |
}, | |
resolve: { | |
alias: { | |
dynamic: require.resolve("./generate.js") | |
} | |
}, | |
module: { | |
rules: [ | |
{ | |
test: require.resolve("./generate.js"), | |
use: { | |
loader: "val-loader", | |
options: {} | |
} | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment