diff --git a/packages/fes-plugin-windicss/src/index.js b/packages/fes-plugin-windicss/src/index.js index ee6c8311..111fc005 100644 --- a/packages/fes-plugin-windicss/src/index.js +++ b/packages/fes-plugin-windicss/src/index.js @@ -1,6 +1,5 @@ import WindiCSSWebpackPlugin from 'windicss-webpack-plugin'; -import { resolve } from 'path'; export default (api) => { api.describe({ @@ -16,10 +15,19 @@ export default (api) => { api.addEntryImportsAhead(() => [{ source: 'windi-base.css' }, { source: 'windi-components.css' }, { source: 'windi-utilities.css' }]); api.chainWebpack((memo, { createCSSRule }) => { + const { config, ...otherOption } = api.config.windicss; memo.plugin('windicss').use(WindiCSSWebpackPlugin, [ { - config: resolve(__dirname, '../windi.config.js'), - ...api.config.windicss + config: { + extract: { + // A common use case is scanning files from the root directory + include: ['**/*.{vue,jsx,js,ts,tsx}'], + // if you are excluding files, make sure you always include node_modules and .git + exclude: ['node_modules', '.git', 'dist'] + }, + ...config + }, + ...otherOption } ]); if (api.env === 'development') { diff --git a/packages/fes-plugin-windicss/windi.config.js b/packages/fes-plugin-windicss/windi.config.js deleted file mode 100644 index 7436c3ab..00000000 --- a/packages/fes-plugin-windicss/windi.config.js +++ /dev/null @@ -1,8 +0,0 @@ -export default { - extract: { - // A common use case is scanning files from the root directory - include: ['**/*.{vue,jsx,js,ts,tsx}'], - // if you are excluding files, make sure you always include node_modules and .git - exclude: ['node_modules', '.git', 'dist'] - } -}; diff --git a/packages/fes-template-h5/.fes.js b/packages/fes-template-h5/.fes.js index b5b8d4ea..75345982 100644 --- a/packages/fes-template-h5/.fes.js +++ b/packages/fes-template-h5/.fes.js @@ -34,5 +34,16 @@ export default { ], devServer: { port: 8000 + }, + windicss: { + config: { + theme: { + extend: { + colors: { + green: '#7cb305' + } + } + } + } } }; diff --git a/packages/fes-template-h5/src/pages/index.vue b/packages/fes-template-h5/src/pages/index.vue index 88138fc6..8cf4ebc3 100644 --- a/packages/fes-template-h5/src/pages/index.vue +++ b/packages/fes-template-h5/src/pages/index.vue @@ -1,5 +1,5 @@