Last active
June 3, 2017 11:22
-
-
Save chitoku-k/dbfb3ccd8814905c92c50d429a74eaf1 to your computer and use it in GitHub Desktop.
webpack.config.js
This file contains hidden or 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
import { path } from 'path'; | |
import { glob } from 'glob'; | |
import { webpack } from 'webpack'; | |
const entries = Object.assign( | |
...glob.sync('./app/webroot/scripts/js/test/**/entry.js') | |
.map(file => ({ [ path.basename(path.dirname(file)) ]: file })) | |
); | |
console.log(Object.keys(entries)) | |
module.exports = { | |
entry: entries, | |
output: { | |
path: path.join(__dirname, 'app/webroot/dist'), | |
filename: '[name].js', | |
}, | |
plugins: [ | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'vendor', | |
chunks: Object.keys(entries), | |
}), | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment