Created
March 13, 2018 21:42
-
-
Save Gazler/996d7cad1692cb597383f3e56074ca07 to your computer and use it in GitHub Desktop.
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
const path = require('path'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
module.exports = { | |
entry: './js/app.js', | |
stats: { | |
colors: true, | |
children: false, | |
modules: false, | |
hash: false, | |
version: false, | |
excludeAssets: (source) => { | |
return ["app.js", "../css/app.css"].indexOf(source) === -1; | |
} | |
}, | |
output: { | |
filename: 'app.js', | |
path: path.resolve(__dirname, '../priv/static/js') | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
use: { | |
loader: 'babel-loader' | |
} | |
}, | |
{ | |
test: /\.css$/, | |
use: ExtractTextPlugin.extract({ | |
fallback: 'style-loader', | |
use: 'css-loader' | |
}) | |
} | |
] | |
}, | |
plugins: [ | |
new ExtractTextPlugin('../css/app.css'), | |
new CopyWebpackPlugin([{ from: 'static/', to: '../' }]) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment