mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
parent
14c7b25fcc
commit
1cdc25ff79
|
@ -19,6 +19,7 @@ import ChunkNamesPlugin from './webpack/plugins/chunk-names-plugin'
|
||||||
import { ReactLoadablePlugin } from './webpack/plugins/react-loadable-plugin'
|
import { ReactLoadablePlugin } from './webpack/plugins/react-loadable-plugin'
|
||||||
import {SERVER_DIRECTORY, NEXT_PROJECT_ROOT, NEXT_PROJECT_ROOT_NODE_MODULES, NEXT_PROJECT_ROOT_DIST, DEFAULT_PAGES_DIR, REACT_LOADABLE_MANIFEST, CLIENT_STATIC_FILES_RUNTIME_WEBPACK, CLIENT_STATIC_FILES_RUNTIME_MAIN} from '../lib/constants'
|
import {SERVER_DIRECTORY, NEXT_PROJECT_ROOT, NEXT_PROJECT_ROOT_NODE_MODULES, NEXT_PROJECT_ROOT_DIST, DEFAULT_PAGES_DIR, REACT_LOADABLE_MANIFEST, CLIENT_STATIC_FILES_RUNTIME_WEBPACK, CLIENT_STATIC_FILES_RUNTIME_MAIN} from '../lib/constants'
|
||||||
import AutoDllPlugin from 'autodll-webpack-plugin'
|
import AutoDllPlugin from 'autodll-webpack-plugin'
|
||||||
|
import TerserPlugin from 'terser-webpack-plugin'
|
||||||
|
|
||||||
// The externals config makes sure that
|
// The externals config makes sure that
|
||||||
// on the server side when modules are
|
// on the server side when modules are
|
||||||
|
@ -81,6 +82,13 @@ function optimizationConfig ({dir, dev, isServer, totalPages}) {
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Terser is a better uglifier
|
||||||
|
config.minimizer = [new TerserPlugin({
|
||||||
|
parallel: true,
|
||||||
|
sourceMap: false,
|
||||||
|
cache: true
|
||||||
|
})]
|
||||||
|
|
||||||
// Only enabled in production
|
// Only enabled in production
|
||||||
// This logic will create a commons bundle
|
// This logic will create a commons bundle
|
||||||
// with modules that are used in 50% of all pages
|
// with modules that are used in 50% of all pages
|
||||||
|
|
60
flow-typed/npm/terser-webpack-plugin_vx.x.x.js
vendored
Normal file
60
flow-typed/npm/terser-webpack-plugin_vx.x.x.js
vendored
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
// flow-typed signature: 7f0a5671a6d757d5e9f880e207a37572
|
||||||
|
// flow-typed version: <<STUB>>/terser-webpack-plugin_v1.0.2/flow_v0.73.0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is an autogenerated libdef stub for:
|
||||||
|
*
|
||||||
|
* 'terser-webpack-plugin'
|
||||||
|
*
|
||||||
|
* Fill this stub out by replacing all the `any` types.
|
||||||
|
*
|
||||||
|
* Once filled out, we encourage you to share your work with the
|
||||||
|
* community by sending a pull request to:
|
||||||
|
* https://github.com/flowtype/flow-typed
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare module 'terser-webpack-plugin' {
|
||||||
|
declare module.exports: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We include stubs for each file inside this npm package in case you need to
|
||||||
|
* require those files directly. Feel free to delete any files that aren't
|
||||||
|
* needed.
|
||||||
|
*/
|
||||||
|
declare module 'terser-webpack-plugin/dist/cjs' {
|
||||||
|
declare module.exports: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'terser-webpack-plugin/dist/index' {
|
||||||
|
declare module.exports: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'terser-webpack-plugin/dist/minify' {
|
||||||
|
declare module.exports: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'terser-webpack-plugin/dist/TaskRunner' {
|
||||||
|
declare module.exports: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'terser-webpack-plugin/dist/worker' {
|
||||||
|
declare module.exports: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filename aliases
|
||||||
|
declare module 'terser-webpack-plugin/dist/cjs.js' {
|
||||||
|
declare module.exports: $Exports<'terser-webpack-plugin/dist/cjs'>;
|
||||||
|
}
|
||||||
|
declare module 'terser-webpack-plugin/dist/index.js' {
|
||||||
|
declare module.exports: $Exports<'terser-webpack-plugin/dist/index'>;
|
||||||
|
}
|
||||||
|
declare module 'terser-webpack-plugin/dist/minify.js' {
|
||||||
|
declare module.exports: $Exports<'terser-webpack-plugin/dist/minify'>;
|
||||||
|
}
|
||||||
|
declare module 'terser-webpack-plugin/dist/TaskRunner.js' {
|
||||||
|
declare module.exports: $Exports<'terser-webpack-plugin/dist/TaskRunner'>;
|
||||||
|
}
|
||||||
|
declare module 'terser-webpack-plugin/dist/worker.js' {
|
||||||
|
declare module.exports: $Exports<'terser-webpack-plugin/dist/worker'>;
|
||||||
|
}
|
|
@ -106,6 +106,7 @@
|
||||||
"source-map": "0.5.7",
|
"source-map": "0.5.7",
|
||||||
"strip-ansi": "3.0.1",
|
"strip-ansi": "3.0.1",
|
||||||
"styled-jsx": "3.0.3-canary.0",
|
"styled-jsx": "3.0.3-canary.0",
|
||||||
|
"terser-webpack-plugin": "1.0.2",
|
||||||
"unfetch": "3.0.0",
|
"unfetch": "3.0.0",
|
||||||
"url": "0.11.0",
|
"url": "0.11.0",
|
||||||
"webpack": "4.17.1",
|
"webpack": "4.17.1",
|
||||||
|
|
Loading…
Reference in a new issue