Kaynağa Gözat

add lodash-webpack-plugin

Yuki Takei 7 yıl önce
ebeveyn
işleme
90ef4ebfe7
4 değiştirilmiş dosya ile 11 ekleme ve 14 silme
  1. 1 0
      .babelrc
  2. 3 14
      config/webpack.common.js
  3. 1 0
      package.json
  4. 6 0
      yarn.lock

+ 1 - 0
.babelrc

@@ -1,4 +1,5 @@
 {
+  "plugins": ["lodash"],
   "presets": [
     ["env", {
       "targets": {

+ 3 - 14
config/webpack.common.js

@@ -9,6 +9,7 @@ const helpers = require('./helpers');
  * Webpack Plugins
  */
 const WebpackAssetsManifest = require('webpack-assets-manifest');
+const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
 
 /*
  * Webpack configuration
@@ -113,23 +114,11 @@ module.exports = (options) => {
         'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
       }),
 
-      // new CommonsChunkPlugin({
-      //   name: 'commons',
-      //   chunks: ['app', 'legacy', 'legacy-form', 'legacy-admin'],
-      //   minChunks: module => /node_modules/.test(module.resource),
-      // }),
-      // new CommonsChunkPlugin({
-      //   name: 'commons',
-      //   chunks: ['commons', 'legacy-presentation'],
-      // }),
-      // new CommonsChunkPlugin({
-      //   name: 'commons',
-      //   chunks: ['commons', 'plugin'],
-      // }),
-
       // ignore
       new webpack.IgnorePlugin(/^\.\/lib\/deflate\.js/, /markdown-it-plantuml/),
 
+      new LodashModuleReplacementPlugin,
+
       new webpack.ProvidePlugin({ // refs externals
         jQuery: 'jquery',
         $: 'jquery',

+ 1 - 0
package.json

@@ -142,6 +142,7 @@
     "jquery-ui": "^1.12.1",
     "jquery.cookie": "~1.4.1",
     "load-css-file": "^1.0.0",
+    "lodash-webpack-plugin": "^0.11.5",
     "markdown-it": "^8.4.0",
     "markdown-it-blockdiag": "^1.0.0",
     "markdown-it-emoji": "^1.4.0",

+ 6 - 0
yarn.lock

@@ -4709,6 +4709,12 @@ locate-path@^2.0.0:
     p-locate "^2.0.0"
     path-exists "^3.0.0"
 
+lodash-webpack-plugin@^0.11.5:
+  version "0.11.5"
+  resolved "https://registry.yarnpkg.com/lodash-webpack-plugin/-/lodash-webpack-plugin-0.11.5.tgz#c4bd064b4f561c3f823fa5982bdeb12c475390b9"
+  dependencies:
+    lodash "^4.17.4"
+
 lodash._arraycopy@^3.0.0:
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz#76e7b7c1f1fb92547374878a562ed06a3e50f6e1"