vyx-hex/webpack.config.js

55 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2019-06-07 14:46:13 +00:00
const HtmlWebpackPlugin = require('html-webpack-plugin'); //installed via npm
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
2019-06-14 14:33:22 +00:00
filename: 'bundle.js',
globalObject: `typeof self !== 'undefined' ? self : this`,
2019-06-07 14:46:13 +00:00
},
module: {
rules: [
{
test: /\.scss$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" },
2019-06-07 18:07:24 +00:00
{ loader: "sass-loader" },
2019-06-07 14:46:13 +00:00
],
},
2019-06-14 14:33:22 +00:00
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: [
'@babel/plugin-transform-runtime',
[
'@babel/plugin-proposal-class-properties',
{ loose: true },
],
],
},
},
},
2019-06-14 10:45:35 +00:00
{
test: /\.worker\.js$/,
use: { loader: 'worker-loader' },
},
2019-06-07 14:46:13 +00:00
],
},
plugins: [
new HtmlWebpackPlugin({ template: './src/index.html' }),
],
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
2019-06-14 21:57:48 +00:00
host: '0.0.0.0',
2019-06-07 14:46:13 +00:00
port: 8080,
hot: true,
}
};