代码拉取完成,页面将自动刷新
const path = require("path")
const DllReferencePlugin = require("webpack/lib/DllReferencePlugin.js");
const AddAssetHtmlWebpackPlugin = require('add-asset-html-webpack-plugin')
const resolve = filePath => path.resolve(__dirname, './', filePath)
const buildConfig = {publicPath: "/plain-ui-doc-v3/"}
process.env.VUE_APP_ENV = JSON.stringify(buildConfig)
module.exports = {
publicPath: buildConfig.publicPath,
outputDir: resolve('docs'),
devServer: {port: '3332',},
pages: {
index: {
entry: resolve('src/pages/index/main.tsx'),
template: 'public/index.html',
filename: 'index.html',
title: 'plain-ui.v3 在线文档',
chunks: ['chunk-vendors', 'chunk-common', 'index'],
},
run: {
entry: resolve('src/pages/run/main.tsx'),
template: 'public/index.html',
filename: 'run.html',
title: 'plain runner',
chunks: ['chunk-vendors', 'chunk-common', 'run'],
},
},
css: {
loaderOptions: {
sass: {
prependData: `@import "src/style/global.scss";`
},
}
},
configureWebpack: {
module: {rules: [{test: /.md$/, loader: 'text-loader'},]},
externals: {
vue: 'Vue',
},
plugins: [
new AddAssetHtmlWebpackPlugin([
{filepath: resolve('src/lib/markdown/markdown-it-attrs.js')},
{filepath: resolve('src/lib/vue.global.js')},
{filepath: resolve('src/lib/babel.min.js')},
{filepath: resolve('src/lib/parse-xml.min.js')},
{filepath: resolve('src/lib/prism/prism.js')},
{filepath: resolve('src/lib/prism/prism.css'), typeOfAsset: 'css'},
{filepath: resolve('dll/dll.js')},
{filepath: resolve('src/lib/iconfont_js/iconfont.js')},
{filepath: resolve('src/lib/iconfont_css/iconfont.css'), typeOfAsset: 'css'},
]),
new DllReferencePlugin({
manifest: require("./dll/dll.manifest.json"),
}),
],
},
chainWebpack: config => {
config.plugins.delete('prefetch-index').delete('preload-index');
config.resolve.alias.delete('vue$');
config.plugin('html-index').tap((args) => {
args[0].chunksSortMode = 'manual'
return args
})
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。