Skip to content

Commit

Permalink
Upgrade to Webpack 4
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Oct 13, 2018
1 parent 2877e5f commit 1a831e8
Show file tree
Hide file tree
Showing 8 changed files with 3,026 additions and 1,400 deletions.
30 changes: 15 additions & 15 deletions client/appfd.js
Expand Up @@ -18,21 +18,21 @@ try {
console.log("Storage exception", e);
}

import "smart-app-banner.css?a=1";
import "bootstrap.min.css";
import "bootstrap-theme.min.css";
import "glyphicons.css";
import "glyphicons-social.css";
import "bootstrap-select.min.css";
import "bootstrap-switch.min.css";
import "bootstrap-dropmenu.min.css";
import "bootstrap-notifications.min.css";
import "eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css";
import "dd.css";
import "bootstrap-fileinput/css/fileinput.css";
require("smart-app-banner.css?a=1");
require("bootstrap.min.css");
require("bootstrap-theme.min.css");
require("glyphicons.css");
require("glyphicons-social.css");
require("bootstrap-select.min.css");
require("bootstrap-switch.min.css");
require("bootstrap-dropmenu.min.css");
require("bootstrap-notifications.min.css");
require("eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css");
require("dd.css");
require("bootstrap-fileinput/css/fileinput.css");

import 'style.less';
import 'user.css';
require("style.less");
require("user.css");

import 'iznik/main';
require("iznik/main");

30 changes: 15 additions & 15 deletions client/appmt.js
Expand Up @@ -7,20 +7,20 @@ try {
console.log("Storage exception", e);
}

import "smart-app-banner.css?a=1";
import "bootstrap.min.css";
import "bootstrap-theme.min.css";
import "glyphicons.css";
import "glyphicons-social.css";
import "bootstrap-select.min.css";
import "bootstrap-switch.min.css";
import "bootstrap-dropmenu.min.css";
import "bootstrap-notifications.min.css";
import "eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css";
import "dd.css";
import "bootstrap-fileinput/css/fileinput.css";
require("smart-app-banner.css?a=1");
require("bootstrap.min.css");
require("bootstrap-theme.min.css");
require("glyphicons.css");
require("glyphicons-social.css");
require("bootstrap-select.min.css");
require("bootstrap-switch.min.css");
require("bootstrap-dropmenu.min.css");
require("bootstrap-notifications.min.css");
require("eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css");
require("dd.css");
require("bootstrap-fileinput/css/fileinput.css");

import 'style.less';
import 'modtools.css';
require("style.less");
require("user.css");

import 'iznik/main';
require("iznik/main");
8 changes: 8 additions & 0 deletions dev/postcss.config.js
@@ -0,0 +1,8 @@
module.exports = {
parser: 'sugarss',
plugins: {
'postcss-import': {},
'postcss-preset-env': {},
'cssnano': {}
}
}
57 changes: 6 additions & 51 deletions dev/webpack.productionfd.config.js
Expand Up @@ -17,21 +17,12 @@ module.exports = new Config().extend('dev/webpack.base.config.js').merge({
{
test: /\.css$/,
use: [
'style-loader',
{
loader: MiniCssExtractPlugin.loader
},

{
loader: "css-loader",
loader: 'css-loader',
options: {
sourceMap: true,
modules: true,
localIdentName: "[local]___[hash:base64:5]"
root: '../'
}
},

{
loader: 'postcss-loader'
}
]
}
Expand All @@ -48,7 +39,9 @@ module.exports = new Config().extend('dev/webpack.base.config.js').merge({
statsOptions: null,
logLevel: 'info'
}),
new new MiniCssExtractPlugin(),
new MiniCssExtractPlugin({
filename: "[name].[chunkhash].css"
}),
new FaviconsPlugin('images/user_logo.png'),
new webpack.DefinePlugin({
FACEBOOK_APPID: JSON.stringify('134980666550322'),
Expand Down Expand Up @@ -78,44 +71,6 @@ module.exports = new Config().extend('dev/webpack.base.config.js').merge({
chunksSortMode: 'dependency'
}),

new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
minimize: true,
compress: {
warnings: false
}
}),

// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
(module.resource.indexOf('quasar') > -1 ||
module.resource.indexOf(join(__dirname, '../node_modules')) === 0)
)
}
}),

// Do some cool async chunk loading, see:
// https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
// https://medium.com/webpack/webpack-bits-getting-the-most-out-of-the-commonschunkplugin-ab389e5f318
new webpack.optimize.CommonsChunkPlugin({
children: true,
async: true,
minChunks: 3
}),

// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),

// do scope hoisting: https://webpack.js.org/plugins/module-concatenation-plugin
// should reduce scripting time and bundle size
new webpack.optimize.ModuleConcatenationPlugin()
Expand Down
42 changes: 3 additions & 39 deletions dev/webpack.productionmt.config.js
Expand Up @@ -48,7 +48,9 @@ module.exports = new Config().extend('dev/webpack.base.config.js').merge({
statsOptions: null,
logLevel: 'info'
}),
new new MiniCssExtractPlugin(),
new MiniCssExtractPlugin({
filename: "[name].[chunkhash].css"
}),
new FaviconsPlugin('images/modtools_logo.png'),
new webpack.DefinePlugin({
FACEBOOK_APPID: JSON.stringify('134980666550322'),
Expand Down Expand Up @@ -78,44 +80,6 @@ module.exports = new Config().extend('dev/webpack.base.config.js').merge({
chunksSortMode: 'dependency'
}),

new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
minimize: true,
compress: {
warnings: false
}
}),

// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
(module.resource.indexOf('quasar') > -1 ||
module.resource.indexOf(join(__dirname, '../node_modules')) === 0)
)
}
}),

// Do some cool async chunk loading, see:
// https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
// https://medium.com/webpack/webpack-bits-getting-the-most-out-of-the-commonschunkplugin-ab389e5f318
new webpack.optimize.CommonsChunkPlugin({
children: true,
async: true,
minChunks: 3
}),

// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),

// do scope hoisting: https://webpack.js.org/plugins/module-concatenation-plugin
// should reduce scripting time and bundle size
new webpack.optimize.ModuleConcatenationPlugin()
Expand Down

0 comments on commit 1a831e8

Please sign in to comment.