Modify your webpack configs to fit qiankun subapp development。
const QiankunDevPlugin = require("qiankun-dev-webpack-plugin");
module.exports = {
// create a new instance to plugins array
plugins: [new QiankunDevPlugin()]
};
You can pass a hash of configuration options to qiankun-dev-webpack-plugin
.
Name | Type | Default | Description |
---|---|---|---|
appName |
{String} |
package.json 's name |
Library namespace |
entryRule |
(src: string) => boolean |
undefined | declare entry tag controlled |
- Set
output.libraryTarget
toumd
modules - Add an
entry
attribute toentry
script tag when usingHtmlWebpackPlugin
(If you do not useHtmlWebpackPlugin
or itsinject
option isfalse
, you MUST config anentry
attribute for the entry script yourself) - Config devServer's header to handle
CORS
request and correct sourcemap url whileprocess.env.NODE_ENV
is set todevelopment
entry script
will be controlled byentryRule
function, see here
- Config
devServer.host
, to change host name - Config
devServer.headers
to allowcors
custom headers - Config
devServer.allowdHosts
ordevServer.disableHostCheck