mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00
feat: export Utils
This commit is contained in:

committed by
Nathan Walker

parent
d46d59abe4
commit
a1abd07c73
@ -7,7 +7,7 @@ import {
|
||||
} from '../helpers/project';
|
||||
|
||||
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
|
||||
import { DefinePlugin } from 'webpack';
|
||||
import { DefinePlugin, HotModuleReplacementPlugin } from 'webpack';
|
||||
import { WatchStateLoggerPlugin } from '../plugins/WatchStateLoggerPlugin';
|
||||
import TerserPlugin from 'terser-webpack-plugin';
|
||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
||||
@ -188,12 +188,17 @@ export default function (config: Config, env: IWebpackEnv): Config {
|
||||
// },
|
||||
// ]);
|
||||
|
||||
// todo: make opt-in with a flag
|
||||
config.plugin('BundleAnalyzerPlugin').use(BundleAnalyzerPlugin);
|
||||
|
||||
// add the WatchStateLogger plugin used to notify the CLI of build state
|
||||
config.plugin('WatchStateLoggerPlugin').use(WatchStateLoggerPlugin);
|
||||
|
||||
config.when(env.hmr, (config) => {
|
||||
config.plugin('HotModuleReplacementPlugin').use(HotModuleReplacementPlugin);
|
||||
});
|
||||
|
||||
config.when(env.report, (config) => {
|
||||
config.plugin('BundleAnalyzerPlugin').use(BundleAnalyzerPlugin);
|
||||
});
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user