Skip to content

Commit

Permalink
build: external dependencies except style modules
Browse files Browse the repository at this point in the history
  • Loading branch information
mirages committed Mar 21, 2021
1 parent 9d4e461 commit 42c69b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ env:
browser: true
es2021: true
jest: true
node: true
extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/recommended'
Expand Down
4 changes: 2 additions & 2 deletions components/vue/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const presets = [
[
'@babel/preset-typescript',
{
isTsx: true,
allExtentions: true
isTSX: true,
allExtensions: true
}
]
]
Expand Down
6 changes: 4 additions & 2 deletions components/vue/scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
const { rollup } = require('rollup')
const fs = require('fs')
const path = require('path')
Expand Down Expand Up @@ -32,12 +33,13 @@ const build = async () => {
extensions: ['.css', '.less'],
autoModules: false, // 关闭自动 css module,使用自定义的 css module
modules: {
generateScopedName: '[local]__[contenthash:base64:8]'
generateScopedName: '[local]__[contenthash:base64:8]',
localsConvention: 'dashes'
},
extract: path.resolve(distDir, 'index.css')
})
],
external: ['vue']
external: id => !/\.(css|less)$/.test(id)
})

await bundle.write({
Expand Down

0 comments on commit 42c69b5

Please sign in to comment.