1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-10 09:02:49 +00:00
Files
go-discord-bot/webpack.config.js

49 lines
1.3 KiB
JavaScript

const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
app: './app/app.js',
vendor: ['react', 'react-dom']
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '/static/[name].js'
},
module: {
rules: [{
test: /\.(js|jsx)$/,
loaders: ['babel-loader']
}, {
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader!postcss-loader!sass-loader'
})
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader'
})
}]
},
plugins: [
new ExtractTextPlugin({
filename: '/static/[name].css',
disable: false,
allChunks: true
}),
new HtmlWebpackPlugin({
filename: 'index.html',
template: './index.html'
}),
new webpack.optimize.CommonsChunkPlugin({
name: ['vendor', 'manifest'],
minChunks: 'Infinity'
})
]
};