From e13e630cd6e4fc0b1ff92098a28a770794c7bb9a Mon Sep 17 00:00:00 2001 From: gabrhr <73925454+gabrhr@users.noreply.github.com> Date: Wed, 20 Apr 2022 10:19:29 -0500 Subject: =?UTF-8?q?A=C3=B1adir=20plantilla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Base para front --- .../internals/webpack/webpack.dll.babel.js | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 front/odiparpack/internals/webpack/webpack.dll.babel.js (limited to 'front/odiparpack/internals/webpack/webpack.dll.babel.js') diff --git a/front/odiparpack/internals/webpack/webpack.dll.babel.js b/front/odiparpack/internals/webpack/webpack.dll.babel.js new file mode 100644 index 0000000..d1ee114 --- /dev/null +++ b/front/odiparpack/internals/webpack/webpack.dll.babel.js @@ -0,0 +1,58 @@ +/** + * WEBPACK DLL GENERATOR + * + * This profile is used to cache webpack's module + * contexts for external library and framework type + * dependencies which will usually not change often enough + * to warrant building them from scratch every time we use + * the webpack process. + */ + +const { join } = require('path'); +const defaults = require('lodash/defaultsDeep'); +const webpack = require('webpack'); +const pkg = require(join(process.cwd(), 'package.json')); // eslint-disable-line +const { dllPlugin } = require('../config'); + +if (!pkg.dllPlugin) { + process.exit(0); +} + +const dllConfig = defaults(pkg.dllPlugin, dllPlugin.defaults); +const outputPath = join(process.cwd(), dllConfig.path); + +module.exports = require('./webpack.base.babel')({ + mode: 'development', + context: process.cwd(), + entry: dllConfig.dlls ? dllConfig.dlls : dllPlugin.entry(pkg), + optimization: { + minimize: false, + }, + devtool: 'eval', + output: { + filename: '[name].dll.js', + path: outputPath, + library: '[name]', + }, + plugins: [ + new webpack.DllPlugin({ + name: '[name]', + path: join(outputPath, '[name].json'), + }), + new webpack.ContextReplacementPlugin(/^\.\/locale$/, context => { + if (!/\/moment\//.test(context.context)) { + return; + } + // context needs to be modified in place + Object.assign(context, { + // include only CJK + regExp: /^\.\/(ja|ko|zh)/, + // point to the locale data folder relative to moment's src/lib/locale + request: './locale' + }); + }) + ], + performance: { + hints: false, + }, +}); -- cgit v1.2.3