@tuia/scene-switch-inject-webpack-plugin

为HTML页面注入多场景切换插件的Webpack插件

Usage no npm install needed!

<script type="module">
  import tuiaSceneSwitchInjectWebpackPlugin from 'https://cdn.skypack.dev/@tuia/scene-switch-inject-webpack-plugin';
</script>

README

scene-switch-inject-webpack-plugin

为HTML页面注入多场景切换插件的Webpack插件

安装

npm i -D @tuia/scene-switch-inject-webpack-plugin

注:该插件依赖 HTML Webpack Plugin

使用

webpack.conf.js

const SceneSwitchInjectPlugin = require("@tuia/scene-switch-inject-webpack-plugin").default

module.exports = {
  plugins: [new SceneSwitchInjectPlugin({ env: ["development", "test"] })]
}

env选项对应process.env.NODE_ENV,当process.env.NODE_ENV在env列表中,多场景切换插件将生效。