@plugin-light/webpack-plugin-fix-import-path
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

修复引用路径错误

对于 common/runtime.jscommon/vendor.js 等文件,打包产物的引用路径可能会发生异常,本插件会根据真实的文件路径来修复。

如何使用

安装

pnpm add @plugin-light/webpack-plugin-fix-import-path -D

vue.config.js 中添加如下设置:

const { FixImportPathPlugin } = require('@plugin-light/webpack-plugin-fix-import-path');


module.exports = {
  configureWebpack: {
    plugins: [
      new FixImportPathPlugin({
        handleList: [
          'common/vendor.js',
          'common/runtime.js',
          'common/main.js',
        ],
        pluginName: 'pluginA',
      })
    ]
  }
}

参数

export interface IFixImportPathOptions {
  // 待处理的文件列表
  handleList?: Array<string>;
  // 插件名称
  pluginName?: string;
}

handleList 默认值

const HANDLE_LIST = [
  'common/vendor.js',
  'common/runtime.js',
  'common/main.js',
];

Readme

Keywords

none

Package Sidebar

Install

npm i @plugin-light/webpack-plugin-fix-import-path

Weekly Downloads

59

Version

0.0.4

License

none

Unpacked Size

8.16 kB

Total Files

7

Last publish

Collaborators

  • yanggwcn