shrub/pkg/interface/config/webpack.dev.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-04-24 02:08:47 +03:00
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const urbitrc = require('./urbitrc')
2020-04-24 02:08:47 +03:00
module.exports = {
entry: {
app: './src/index.js'
},
module: {
rules: [
{
test: /\.js?$/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-optional-chaining',
]
}
},
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [ '.js' ],
},
devtool: 'inline-source-map',
// devServer: {
// contentBase: path.join(__dirname, './'),
// hot: true,
// port: 9000,
// historyApiFallback: true
// },
2020-04-24 02:08:47 +03:00
plugins: [
new CleanWebpackPlugin(),
// new HtmlWebpackPlugin({
// title: 'Hot Module Replacement',
// template: './public/index.html',
// }),
2020-04-24 02:08:47 +03:00
],
output: {
filename: 'index.js',
chunkFilename: 'index.js',
path: path.resolve(urbitrc.URBIT_PIERS[0] + '/app/launch/', 'js'),
2020-04-24 02:08:47 +03:00
publicPath: '/'
},
};