Skip to content

Instantly share code, notes, and snippets.

@Gazler
Created March 13, 2018 21:42
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 Gazler/996d7cad1692cb597383f3e56074ca07 to your computer and use it in GitHub Desktop.
Save Gazler/996d7cad1692cb597383f3e56074ca07 to your computer and use it in GitHub Desktop.
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