Skip to content

Instantly share code, notes, and snippets.

@jhnns
Created May 12, 2017 23:42
Show Gist options
  • Save jhnns/2ec8461a9f4dfa9f18031b9d64b844b8 to your computer and use it in GitHub Desktop.
Save jhnns/2ec8461a9f4dfa9f18031b9d64b844b8 to your computer and use it in GitHub Desktop.
Dynamic modules
module.exports = options => ({
cacheable: true,
code: "console.log('Hello')"
}};
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