Skip to content

Instantly share code, notes, and snippets.

@fakiolinho
Created March 8, 2018 09:55
Show Gist options
  • Save fakiolinho/030ed192f62843f938f7d55f33b144a7 to your computer and use it in GitHub Desktop.
Save fakiolinho/030ed192f62843f938f7d55f33b144a7 to your computer and use it in GitHub Desktop.
const { resolve } = require('path');
module.exports = {
context: resolve(__dirname, '../'),
entry: ['babel-polyfill', './app/js/main.js'],
resolve: {
extensions: [
'*', '.js', '.jsx',
],
modules: [
resolve(__dirname, '../app'),
'node_modules',
],
},
output: {
filename: '[name]-[hash:6].js',
path: resolve(__dirname, '../build'),
publicPath: '/',
},
module: {
rules: [
...
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
API_URL: JSON.stringify(process.env.API_URL),
},
}),
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment