Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
app: './web/static/js/app.js',
styles: './web/static/css/app.css'
},
output: {
path: path.join(__dirname, "priv/static/dist"),
filename: '[name].[hash].js'
},
module: {
rules: [{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['env']
}
}]
},
plugins: [
new CopyWebpackPlugin([{
from: './web/static/assets/',
to: '../'
}]),
new ExtractTextPlugin({
filename: '[name].[hash].css',
publicPath: './web/static/assets/',
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.