Gcaufy 29e16edf9f test(plugin-define): fix timeout time 4 years ago
..
test 29e16edf9f test(plugin-define): fix timeout time 4 years ago
.npmignore f94e20b73d feat(plugin-define): added plugin-define 5 years ago
CHANGELOG.md d995f52a61 chore(release): publish v2.1.0 4 years ago
README.md 428303a1fd add English and Chinese translation 4 years ago
README_EN.md 428303a1fd add English and Chinese translation 4 years ago
index.js 02aa812725 style: eslint auto fix 5 years ago
package.json d995f52a61 chore(release): publish v2.1.0 4 years ago

README.md

English | 简体中文

wepy define plugin

安装

npm install @wepy/plugin-define --save-dev

配置方式

wepy.config.js

const DefinePlugin = require('@wepy/plugin-define');

module.exports = {
  plugins: [
    DefinePlugin({
      BASE_URL: JSON.stringify('http://foobar.com'),
      'process.env.NODE_ENV': 'development',
      'typeof window': JSON.stringify('undefined'),
      DEV: true
    })
  ]
};

参考网站

webpack.DefinePlugin