refactor: webpack configuration (#398)

* refactor: webpack configuration

* feat: webpack hot reloading

Co-authored-by: Johnny Almonte <johnny243@users.noreply.github.com>
This commit is contained in:
Johnny A
2020-05-07 12:11:44 -04:00
committed by GitHub
parent 78e4ae0a16
commit e61cb53c75
5 changed files with 40 additions and 17 deletions

View File

@@ -2,20 +2,12 @@ const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './app/assets/javascripts/index.ts',
output: {
filename: './javascripts/app.js'
},
devServer: {
proxy: {
'/extensions': {
target: 'http://localhost:3001',
pathRewrite: { '^/extensions': '/public/extensions' }
}
},
port: 3001
},
plugins: [
new webpack.DefinePlugin({
__VERSION__: JSON.stringify(require('./package.json').version)
@@ -27,10 +19,9 @@ module.exports = {
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
filename: './stylesheets/app.css',
ignoreOrder: false // Enable to remove warnings about conflicting order
ignoreOrder: true // Enable to remove warnings about conflicting order
})
],
devtool: 'source-map',
resolve: {
extensions: ['.ts', '.js'],
alias: {