Skip to content

Instantly share code, notes, and snippets.

@JacobKnaack
Last active June 13, 2019 23:59
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 JacobKnaack/c9c12201d942eade2074b6b9dc716b65 to your computer and use it in GitHub Desktop.
Save JacobKnaack/c9c12201d942eade2074b6b9dc716b65 to your computer and use it in GitHub Desktop.
Cosmic Messenger INITIAL webpack config file
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const dev = Boolean(process.env.NODE_ENV !== 'production');
module.exports = {
entry: './src/app.js',
mode: dev ? 'development' : 'production',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
},
{
test: /\.(scss|css)$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.(png|jpg|gif|svg)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 5000
}
}
]
}
]
},
resolve: {
extensions: ['*', '.js', '.jsx']
},
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: 'bundle.js'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new CleanWebpackPlugin,
],
devServer: {
contentBase: './dist',
hot: true
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment