Skip to content

Instantly share code, notes, and snippets.

@shnjp
Created May 18, 2017 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shnjp/12539c3e2bc792d867a8cbb3cf9f631e to your computer and use it in GitHub Desktop.
Save shnjp/12539c3e2bc792d867a8cbb3cf9f631e to your computer and use it in GitHub Desktop.
/* eslint-disable require-jsdoc */
const SOURCE_DIR = `${__dirname}/src/js`
const DEST_DIR = `${__dirname}/static`
console.log(SOURCE_DIR)
console.log(DEST_DIR)
module.exports = {
entry: {
main: ['babel-polyfill', `${SOURCE_DIR}/main.es6`],
},
output: {
path: DEST_DIR,
filename: '[name].bundle.js',
chunkFilename: '[id].[chunkhash].chunked.js',
},
module: {
rules: [
{
exclude: /node_modules/,
loader: 'babel-loader',
options: {
cacheDirectory: true,
},
test: /\.es6$/,
},
],
},
resolve: {
extensions: ['.es6', '.js'],
modules: [
SOURCE_DIR,
'node_modules',
],
},
plugins: [
new DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
'process.env.NAUMANNI_VERSION': JSON.stringify(process.env.NAUMANNI_VERSION),
}),
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment