reinstate css minification, rename *.css to *.less

This commit is contained in:
mappu 2017-11-12 10:51:09 +13:00
parent e44298c172
commit 02e8b407c3
5 changed files with 45 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/* dcwebui.js */
require("./dcwebui.css");
require("./dcwebui.less");
require("./socket.io-1.7.2.js");
"use strict";

17
package-lock.json generated
View File

@ -2087,6 +2087,23 @@
"source-map": "0.5.7"
}
},
"less-loader": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/less-loader/-/less-loader-4.0.5.tgz",
"integrity": "sha1-rhVadAbKxqzSk9eFWH/P8PR4xN0=",
"requires": {
"clone": "2.1.1",
"loader-utils": "1.1.0",
"pify": "2.3.0"
},
"dependencies": {
"clone": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz",
"integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs="
}
}
},
"less-plugin-clean-css": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/less-plugin-clean-css/-/less-plugin-clean-css-1.5.1.tgz",

View File

@ -18,6 +18,7 @@
"css-loader": "^0.28.7",
"html-minifier": "^3.5.6",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"less-plugin-clean-css": "^1.5.1",
"style-loader": "^0.19.0",
"uglify-js": "^3.1.8",

View File

@ -1,4 +1,7 @@
var webpack = require("webpack");
/*! webpack.config.js */
const webpack = require("webpack");
const CleanCSSPlugin = require("less-plugin-clean-css");
module.exports = {
entry: "./client/dcwebui.js",
@ -8,7 +11,28 @@ module.exports = {
},
module: {
loaders: [
{ test: /\.css$/, loader: "style-loader!css-loader" }
// Plain CSS files (no longer present)
{ test: /\.css$/, loader: "style-loader!css-loader" },
// LESS CSS files
{
test: /\.less$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" },
{
loader: "less-loader",
options: {
noIeCompat: false,
plugins: [
new CleanCSSPlugin({ advanced: true })
]
}
}
]
}
]
},
plugins: [