Created
November 14, 2018 15:51
-
-
Save ethanhinson/0b0643bef695ed67fbd173b76c77177a to your computer and use it in GitHub Desktop.
Webpack Define plugin example
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
const merge = require('webpack-merge'); | |
const webpack = require('webpack'); | |
const prod = require('./webpack.prod'); | |
module.exports = merge(prod, { | |
plugins: [ | |
new webpack.DefinePlugin({ | |
foo: JSON.stringify('bar'), | |
someProps: JSON.stringify({ | |
one: 2, | |
buckle: true, | |
myShoe: false, | |
aNested: { | |
object: { | |
object2: 'foo', | |
}, | |
}, | |
}), | |
}), | |
], | |
output: { | |
path: `${__dirname}/public/with-opts`, | |
publicPath: '/', | |
filename: 'bundle.js', | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment