Browse Source

things needed to run webpack again

pull/2/head
Marek Piasecki 6 years ago
parent
commit
781e7c23ee
  1. 2
      .gitignore
  2. 1
      public/.gitkeep
  3. 29
      tools/bundler/webpack/package.json
  4. 28
      tools/bundler/webpack/webpack.prod.config.js

2
.gitignore

@ -4,7 +4,7 @@ node_modules/*
*.log*
services/init.coffee
public/*
!public/.gitignore
!public/.gitkeep
.byebug_history
.vagrant
_site

1
public/.gitkeep

@ -0,0 +1 @@

29
tools/bundler/webpack/package.json

@ -11,24 +11,25 @@
"license": "ISC",
"dependencies": {
"autoprefixer-loader": "^3.2.0",
"backbone-events-standalone": "^0.2.7",
"coffee-loader": "^0.9.0",
"coffee-script": "^1.10.0",
"css-loader": "^0.28.9",
"file-loader": "^1.1.9",
"coffeescript": ">= 1.x < 2",
"compression-webpack-plugin": "^1.0.0",
"css-loader": "^0.28.11",
"file-loader": "^1.1.11",
"http-server": "^0.11.1",
"img-loader": "^2.0.1",
"node-sass": "^4.7.2",
"postcss-loader": "^2.1.0",
"sass-loader": "^6.0.6",
"style-loader": "^0.20.2",
"svgo": "^1.0.4",
"svgo-loader": "^2.1.0",
"url-loader": "^0.6.2",
"backbone-events-standalone": "^0.2.7",
"imba": "somebee/imba",
"img-loader": "^2.0.1",
"lodash": "^4.11.1",
"node-sass": "^4.7.2",
"pro-router": "^4.3.0",
"compression-webpack-plugin": "^1.0.0",
"webpack": "^3.5.5"
"sass-loader": "^6.0.7",
"style-loader": "^0.20.3",
"svgo": "^1.0.5",
"svgo-loader": "^2.1.0",
"uglifyjs-webpack-plugin": "^1.2.3",
"url-loader": "^1.0.1",
"webpack": "^4.1.1",
"webpack-cli": "^2.0.12"
}
}

28
tools/bundler/webpack/webpack.prod.config.js

@ -1,7 +1,9 @@
const webpack = require('webpack');
const CompressionPlugin = require("compression-webpack-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'production',
cache: false,
context: __dirname,
entry: '../../../services/init',
@ -12,25 +14,16 @@ module.exports = {
path: __dirname + '/../../../public',
filename: 'bundle.js'
},
optimization: {
minimize: true,
minimizer: [
new UglifyJsPlugin({
exclude: [/\.min\.js$/gi] // skip pre-minified libs
})
]
},
devtool: 'cheap-module-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
new webpack.optimize.UglifyJsPlugin({
mangle: true,
compress: {
warnings: false, // Suppress uglification warnings
pure_getters: true,
unsafe: true,
unsafe_comps: true,
screw_ie8: true
},
output: {
comments: false,
},
exclude: [/\.min\.js$/gi] // skip pre-minified libs
}),
new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]),
new webpack.NoEmitOnErrorsPlugin(),
new CompressionPlugin({
@ -48,7 +41,6 @@ module.exports = {
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{ loader: 'autoprefixer-loader', options: { browsers: 'last 3 versions' } },
{ loader: 'sass-loader', options: { outputStyle: 'expanded' } }
]
},

Loading…
Cancel
Save