Skip to content

Commit

Permalink
webpack configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hackingbeauty committed Apr 7, 2019
1 parent 2261660 commit 6e883f2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@babel/preset-react"
],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-decorators", {"decoratorsBeforeExport": true}],
["@babel/plugin-proposal-class-properties", { "loose" : true }]
]
}
35 changes: 0 additions & 35 deletions server.js

This file was deleted.

3 changes: 2 additions & 1 deletion webpack/common.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const common = {

output: {
path: PATHS.build,
filename: 'bundle.js'
filename: 'bundle.js',
publicPath: ''
},

resolve: {
Expand Down
3 changes: 0 additions & 3 deletions webpack/dev.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import HtmlWebpackPlugin from 'html-webpack-plugin'
module.exports = {
mode: 'development',
devtool: 'source-map',
output: {
publicPath: ''
},

devServer: {
stats: 'errors-only', // Display only errors to reduce the amount of output.
Expand Down
28 changes: 7 additions & 21 deletions webpack/prod.config.babel.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
import webpack from 'webpack'
import path from 'path'
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import CopyWebpackPlugin from 'copy-webpack-plugin'

module.exports = {
mode: 'production',
entry: [],

output: {
publicPath: ''
},
stats: 'errors-only',

module: {
rules: [
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader'
},
{
loader: 'resolve-url-loader'
},
{ loader: MiniCssExtractPlugin.loader },
{ loader: 'css-loader' },
{ loader: 'resolve-url-loader' },
{
loader: 'sass-loader',
options: {
Expand All @@ -47,19 +38,14 @@ module.exports = {
},
__DEVELOPMENT__: false
}),
new ExtractTextPlugin({ filename: 'bundle.css' }),
new MiniCssExtractPlugin({ filename: '[name].css' }),
new HtmlWebpackPlugin({
template: 'src/index.html'
}),
new HtmlWebpackPlugin({
filename: 'manifest.json',
template: 'src/manifest.json',
inject: false
}),
new CopyWebpackPlugin([
{
from: 'src/assets',
to: 'assets'
from: 'src/manifest.json',
to: 'manifest.json'
}
])
]
Expand Down

0 comments on commit 6e883f2

Please sign in to comment.