@plugin-light/webpack-loader-cross-platform
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

跨平台关键词编译

跨平台的关键词编译,替换关键词@TIP_PLATFORM_NAME

如何使用

安装

pnpm add @plugin-light/webpack-loader-cross-platform -D

vue.config.js 中配置如下:

const { LOADER as crossPlatform, LOADER_PROD as crossPlatformProd } = require('webpack-loader-cross-platform')';

module.export = {
  chainWebpack(config) {
    config.module
      .rule('vue')
      .test(/\.vue$/)
      .use(crossPlatform) 
      // 处理样式的loader,必须在vue-loader前执行
      .loader(crossPlatform)
      .end();

  config.module
    .rule('js')
    .test(/\.[jt]s$/)
    .use(crossPlatformProd) 
    .loader(crossPlatformProd)
    .end();
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @plugin-light/webpack-loader-cross-platform

Weekly Downloads

3

Version

0.0.7

License

none

Unpacked Size

2.77 kB

Total Files

8

Last publish

Collaborators

  • yanggwcn