Update node dependencies and dist bundle

This commit is contained in:
Bartek Fabiszewski 2020-05-16 22:24:54 +02:00
parent 18a3e07ecf
commit ef5aaba951
9 changed files with 1522 additions and 977 deletions

2
css/dist/main.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
js/dist/1.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
js/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2406
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,41 +19,41 @@
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.8.4", "@babel/cli": "^7.8.4",
"@babel/core": "^7.9.0", "@babel/core": "^7.9.6",
"@babel/plugin-transform-runtime": "^7.9.0", "@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "^7.9.5", "@babel/preset-env": "^7.9.6",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0", "babel-loader": "^8.1.0",
"browserlist": "^1.0.1", "browserlist": "^1.0.1",
"clean-webpack-plugin": "^3.0.0", "clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.1.1", "copy-webpack-plugin": "^6.0.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"csso": "^4.0.3", "csso": "^4.0.3",
"eslint": "^6.8.0", "eslint": "^7.0.0",
"eslint-plugin-import": "^2.20.2", "eslint-plugin-import": "^2.20.2",
"eslint-plugin-jasmine": "^4.1.0", "eslint-plugin-jasmine": "^4.1.1",
"husky": "^4.2.5", "husky": "^4.2.5",
"istanbul-instrumenter-loader": "^3.0.1", "istanbul-instrumenter-loader": "^3.0.1",
"jasmine": "^3.5.0", "jasmine": "^3.5.0",
"karma": "^5.0.1", "karma": "^5.0.7",
"karma-chrome-launcher": "^3.1.0", "karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-reporter": "^2.1.1", "karma-coverage-istanbul-reporter": "^3.0.2",
"karma-jasmine": "^3.1.1", "karma-jasmine": "^3.1.1",
"karma-sourcemap-loader": "^0.3.7", "karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^4.0.2", "karma-webpack": "^4.0.2",
"prepush-if-changed": "^1.0.8", "prepush-if-changed": "^1.0.8",
"puppeteer": "^2.1.1", "puppeteer": "^3.0.4",
"regenerator-runtime": "^0.13.5", "regenerator-runtime": "^0.13.5",
"stylelint": "^13.3.2", "stylelint": "^13.3.3",
"stylelint-config-standard": "^20.0.0", "stylelint-config-standard": "^20.0.0",
"terser-webpack-plugin": "^2.3.5", "terser-webpack-plugin": "^3.0.1",
"webpack": "^4.42.1", "webpack": "^4.43.0",
"webpack-cli": "^3.3.11", "webpack-cli": "^3.3.11",
"webpack-merge": "^4.2.2" "webpack-merge": "^4.2.2"
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.9.2", "@babel/runtime": "^7.9.6",
"@babel/runtime-corejs3": "^7.9.2", "@babel/runtime-corejs3": "^7.9.6",
"chartist": "^0.11.4", "chartist": "^0.11.4",
"chartist-plugin-axistitle": "0.0.7", "chartist-plugin-axistitle": "0.0.7",
"ol": "^6.3.1" "ol": "^6.3.1"

View File

@ -3,6 +3,16 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin');
const csso = require('csso'); const csso = require('csso');
const fs = require('fs'); const fs = require('fs');
const cssDist = path.resolve(__dirname, 'css/dist');
const cssTransform = (content, filename) => {
const basename = path.basename(filename);
const result = csso.minify(content.toString(), {
filename: basename,
sourceMap: true
});
fs.writeFile(`css/dist/${basename}.map`, result.map.toString(), (err) => { if (err) { throw err; }});
return `${result.css}\n/*# sourceMappingURL=${basename}.map */`;
}
module.exports = { module.exports = {
entry: './js/src/ulogger.js', entry: './js/src/ulogger.js',
@ -15,22 +25,13 @@ module.exports = {
new CleanWebpackPlugin({ new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: [ '**/*', '!.*' ] cleanOnceBeforeBuildPatterns: [ '**/*', '!.*' ]
}), }),
new CopyWebpackPlugin([ new CopyWebpackPlugin({
{ patterns: [
from: '{css/src/*.css,node_modules/ol/ol.css,node_modules/chartist/dist/chartist.css}', { from: 'css/src/*.css', to: cssDist, flatten: true, transform: cssTransform },
to: path.resolve(__dirname, 'css/dist'), { from: 'node_modules/ol/ol.css', to: cssDist, flatten: true, transform: cssTransform },
flatten: true, { from: 'node_modules/chartist/dist/chartist.css', to: cssDist, flatten: true, transform: cssTransform }
transform: (content, filename) => { ]
const basename = path.basename(filename); })
const result = csso.minify(content.toString(), {
filename: basename,
sourceMap: true
});
fs.writeFile(`css/dist/${basename}.map`, result.map.toString(), (err) => { if (err) { throw err; }});
return `${result.css}\n/*# sourceMappingURL=${basename}.map */`;
}
}
])
], ],
optimization: { optimization: {
splitChunks: { splitChunks: {