Upgrade webpack

This commit is contained in:
Jordan Eldredge 2018-11-19 19:45:40 -08:00
parent e1ec7b7497
commit 629b63b40c
10 changed files with 1036 additions and 946 deletions

View file

@ -33,10 +33,7 @@
]
},
"library": {
"plugins": [
"babel-plugin-remove-webpack",
"@babel/plugin-transform-runtime"
]
"plugins": ["@babel/plugin-transform-runtime"]
},
"production": {
"plugins": ["@babel/plugin-syntax-dynamic-import"]

View file

@ -74,6 +74,11 @@ module.exports = {
}),
new HtmlWebpackInlineSVGPlugin({ runPreEmit: true })
],
performance: {
// We do some crazy shit okay! Don't judge!
maxEntrypointSize: 7000000,
maxAssetSize: 7000000
},
entry: {
webamp: ["./js/index.js"]
},

View file

@ -5,6 +5,7 @@ const common = require("./webpack.common.js");
module.exports = merge(common, {
devtool: "source-map",
mode: "development",
plugins: [
new webpack.DefinePlugin({
SENTRY_DSN: JSON.stringify(

View file

@ -1,9 +1,9 @@
const path = require("path");
const webpack = require("webpack");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
module.exports = {
mode: "production",
resolve: {
extensions: [".js", ".ts", ".tsx"]
},
@ -50,11 +50,6 @@ module.exports = {
reportFilename: "library-report.html",
openAnalyzer: false
}),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
}),
new UglifyJsPlugin({
include: /\.min\.js$/,
parallel: true,
@ -66,6 +61,11 @@ module.exports = {
}
})
],
performance: {
// We do some crazy shit okay! Don't judge!
maxEntrypointSize: 900000,
maxAssetSize: 900000
},
entry: {
bundle: "./js/webamp.js",
"bundle.min": "./js/webamp.js",

View file

@ -11,6 +11,7 @@ const gitRevisionPlugin = new GitRevisionPlugin();
const config = merge(common, {
devtool: "source-map",
mode: "production",
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: "static",

View file

@ -26,9 +26,9 @@ async function loadInitialDependencies(): Promise<
)
]);
return {
butterchurn,
minimalPresets: butterchurnMinimalPresets.getPresets(),
presetKeys: presetPackMeta.getMainPresetMeta().presets
butterchurn: butterchurn.default,
minimalPresets: butterchurnMinimalPresets.default.getPresets(),
presetKeys: presetPackMeta.default.getMainPresetMeta().presets
};
}

View file

@ -5,7 +5,7 @@ import {
LoadStyle,
TimeMode
} from "./types";
import * as baseSkin from "./baseSkin.json";
import baseSkin from "./baseSkin.json";
export const BANDS: Band[] = [
60,
170,

View file

@ -219,9 +219,10 @@ Raven.context(async () => {
],
enableHotkeys: true,
requireJSZip: () =>
import(/* webpackChunkName: "jszip" */ "jszip/dist/jszip"),
import(/* webpackChunkName: "jszip" */ "jszip/dist/jszip").default,
requireMusicMetadata: () =>
import(/* webpackChunkName: "music-metadata-browser" */ "music-metadata-browser/dist/index"),
import(/* webpackChunkName: "music-metadata-browser" */ "music-metadata-browser/dist/index")
.default,
__enableMediaLibrary: library,
__initialWindowLayout,
__initialState: screenshot ? screenshotInitialState : initialState,

View file

@ -71,25 +71,24 @@
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^9.0.0-beta.3",
"babel-jest": "^23.4.2",
"babel-loader": "^8.0.0-beta.6",
"babel-plugin-remove-webpack": "^1.1.0",
"babel-loader": "^8.0.4",
"butterchurn": "^2.5.4",
"butterchurn-presets": "^2.4.7",
"canvas-mock": "0.0.0",
"classnames": "^2.2.5",
"copy-webpack-plugin": "^4.5.1",
"css-loader": "^0.28.4",
"copy-webpack-plugin": "^4.6.0",
"css-loader": "^1.0.1",
"eslint": "4.16.0",
"eslint-config-prettier": "^2.3.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-no-constructor-bind": "^1.2.1",
"eslint-plugin-prettier": "^2.2.0",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^1.1.5",
"git-revision-webpack-plugin": "^2.5.1",
"file-loader": "^2.0.0",
"git-revision-webpack-plugin": "^3.0.3",
"gzip-size-cli": "^2.0.0",
"html-webpack-inline-svg-plugin": "^1.2.4",
"html-webpack-plugin": "^3.0.6",
"html-webpack-plugin": "^3.2.0",
"http-server": "^0.11.1",
"idb-kv-store": "^4.4.0",
"invariant": "^2.2.3",
@ -117,19 +116,20 @@
"redux-thunk": "^2.1.0",
"reselect": "^3.0.1",
"screenfull": "^3.3.2",
"style-loader": "^0.19.1",
"style-loader": "^0.23.1",
"tinyqueue": "^1.2.3",
"travis-weigh-in": "^1.0.2",
"typescript": "^3.0.1",
"uglifyjs-webpack-plugin": "^1.2.5",
"url-loader": "^0.6.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-dev-server": "^2.7.1",
"url-loader": "^1.1.2",
"webpack": "^4.26.0",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10",
"webpack-merge": "^4.1.2",
"webpack-pwa-manifest": "^3.6.2",
"webpack-pwa-manifest": "^3.7.1",
"winamp-eqf": "^1.0.0",
"workbox-webpack-plugin": "^3.0.0"
"workbox-webpack-plugin": "^3.6.3"
},
"jest": {
"globalSetup": "jest-environment-puppeteer/setup",

1917
yarn.lock

File diff suppressed because it is too large Load diff