mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-20 22:43:43 +00:00
add build:dll
This commit is contained in:
+11
-1
@@ -36,5 +36,15 @@ export default {
|
||||
["import", { "libraryName": "antd", "style": true}]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"dllPlugin": {
|
||||
"exclude": [
|
||||
"babel-runtime"
|
||||
],
|
||||
"include": [
|
||||
"dva/router",
|
||||
"dva/saga",
|
||||
"dva/fetch",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -50,6 +50,7 @@
|
||||
"scripts": {
|
||||
"dev": "set BROWSER=none&&set HOST=0.0.0.0&&roadhog server",
|
||||
"lint": "eslint --fix --ext .js src",
|
||||
"build": "roadhog build"
|
||||
"build": "roadhog build",
|
||||
"build:dll": "roadhog buildDll"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
}
|
||||
})()
|
||||
</script>
|
||||
<script src="roadhog.dll.js"></script>
|
||||
<script src="/index.js"></script>
|
||||
</body>
|
||||
|
||||
|
||||
+15
-15
@@ -1,21 +1,22 @@
|
||||
module.exports = (webpackConfig) => {
|
||||
module.exports = (webpackConfig, env) => {
|
||||
// FilenameHash
|
||||
// https://webpack.js.org/configuration/output/#output-chunkfilename
|
||||
webpackConfig.output.chunkFilename = '[name].[hash].js'
|
||||
|
||||
// ClassnameHash
|
||||
// webpackConfig.module.rules.map((item) => {
|
||||
// if (item.use && item.use[0] === 'style') {
|
||||
// return item.use.map((iitem) => {
|
||||
// if (iitem && iitem.loader === 'css') {
|
||||
// iitem.options.localIdentName = '[hash:base64:5]'
|
||||
// }
|
||||
// return iitem
|
||||
// })
|
||||
// }
|
||||
// return item
|
||||
// })
|
||||
|
||||
if (env === 'production' && webpackConfig.module) {
|
||||
// ClassnameHash
|
||||
webpackConfig.module.rules.map((item) => {
|
||||
if (item.use && item.use[0] === 'style') {
|
||||
return item.use.map((iitem) => {
|
||||
if (iitem && iitem.loader === 'css') {
|
||||
iitem.options.localIdentName = '[hash:base64:5]'
|
||||
}
|
||||
return iitem
|
||||
})
|
||||
}
|
||||
return item
|
||||
})
|
||||
}
|
||||
|
||||
// PreLoaders
|
||||
// webpackConfig.module.preLoaders = [{
|
||||
@@ -24,7 +25,6 @@ module.exports = (webpackConfig) => {
|
||||
// loader: 'eslint',
|
||||
// }]
|
||||
|
||||
|
||||
// Alias
|
||||
webpackConfig.resolve.alias = {
|
||||
components: `${__dirname}/src/components`,
|
||||
|
||||
Reference in New Issue
Block a user