From 5e499b019606f9ce90d933fae78b813fe06df4b4 Mon Sep 17 00:00:00 2001 From: zazzaz Date: Thu, 24 Sep 2020 11:13:53 +0800 Subject: [PATCH] build: update website build --- package.json | 3 ++- website/entry.js | 2 +- website/index.tpl | 3 --- website/webpack.config.js | 44 +++++++++++++++++++++++------------- yarn.lock | 47 ++++++++++++++++++++++++++++++++++++++- 5 files changed, 78 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 6b529461c5..2d83bdf3d7 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "build:lib": "rimraf lib && webpack --config ./build/webpack.config.js", "build:theme": "rimraf packages/theme-chalk/lib && gulp build --gulpfile packages/theme-chalk/gulpfile.js && cp-cli packages/theme-chalk/lib lib/theme-chalk", "lint": "eslint ./packages --ext .vue,.js,.ts", - "website-build": "webpack --config ./website/webpack.config.js", + "website-build": "rimraf website-dist && cross-env NODE_ENV=production webpack --config ./website/webpack.config.js", "website-dev": "webpack-dev-server --config ./website/webpack.config.js", "website-dev:play": "cross-env PLAY_ENV=true yarn website-dev" }, @@ -53,6 +53,7 @@ "markdown-it-anchor": "^5.3.0", "markdown-it-chain": "^1.3.0", "markdown-it-container": "^3.0.0", + "mini-css-extract-plugin": "^0.11.2", "rimraf": "^3.0.2", "sass": "^1.26.10", "sass-loader": "^10.0.1", diff --git a/website/entry.js b/website/entry.js index b2cb1c66d1..f3705699ca 100644 --- a/website/entry.js +++ b/website/entry.js @@ -18,7 +18,7 @@ dayjs.locale('zh-cn') // todo: locale based on Doc site lang import App from './app.vue' import ElementPlus from 'element-plus' -if(process.env.NODE_ENV === 'development') require('../src/style/element-ui@2.13.2.css') +import '../packages/theme-chalk/src/index.scss' const app = createApp(App) diff --git a/website/index.tpl b/website/index.tpl index 468f236684..3df93f353e 100644 --- a/website/index.tpl +++ b/website/index.tpl @@ -10,9 +10,6 @@
- <% if (process.env.NODE_ENV === 'production') { %> - - <% } %> <% if (process.env.NODE_ENV === 'production') { %>