Skip to content

Commit

Permalink
fix(cli): 修复了node_modules的依赖包没被webpack扫进去的bug
Browse files Browse the repository at this point in the history
affects: @varlet/cli
  • Loading branch information
haoziqaq committed Nov 3, 2020
1 parent c0aed5b commit 128a0fa
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
3 changes: 2 additions & 1 deletion packages/varlet-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dev": "tsc --watch",
"build": "tsc"
},
"gitHead": "5d0fd4bae88bc6f65335da5cfb944489cca16693",
"gitHead": "c0aed5bc04c05335b66607dbcab6455dafad1de4",
"dependencies": {
"@babel/core": "^7.12.3",
"@babel/plugin-transform-runtime": "^7.12.1",
Expand All @@ -40,6 +40,7 @@
"chalk": "^4.1.0",
"clean-webpack-plugin": "^3.0.0",
"commander": "^6.2.0",
"core-js": "^3.6.5",
"css-loader": "^5.0.0",
"fork-ts-checker-webpack-plugin": "^5.2.1",
"fs-extra": "^9.0.1",
Expand Down
1 change: 0 additions & 1 deletion packages/varlet-cli/site/pc/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ import App from './App.vue'

const app = createApp(App as any)
app.mount('#app')

20 changes: 12 additions & 8 deletions packages/varlet-cli/src/config/webpack.base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,18 @@ export function createBabelConfig() {
return {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-transform-runtime'],
targets: {
"ie": "11"
}
presets: [
[
'@babel/preset-env',
{
targets: {
chrome: "58",
ie: "11"
}
}
]
],
plugins: ['@babel/plugin-transform-runtime']
}
}
}
Expand Down Expand Up @@ -98,15 +105,13 @@ export function createBaseConfig() {
{
test: /\.vue$/,
use: ['cache-loader', 'vue-loader'],
exclude: /node_modules/
},
{
test: /\.js$/,
use: [
'cache-loader',
createBabelConfig()
],
exclude: /node_modules/
},
{
test: /\.ts$/,
Expand All @@ -118,7 +123,6 @@ export function createBaseConfig() {
options: { appendTsSuffixTo: [/\.vue$/] }
}
],
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|jpeg|svg)$/,
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-vue": "^7.1.0"
},
"gitHead": "5d0fd4bae88bc6f65335da5cfb944489cca16693",
"gitHead": "c0aed5bc04c05335b66607dbcab6455dafad1de4",
"peerDependencies": {
"eslint": "^7.12.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-stylelint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^20.0.0"
},
"gitHead": "5d0fd4bae88bc6f65335da5cfb944489cca16693",
"gitHead": "c0aed5bc04c05335b66607dbcab6455dafad1de4",
"peerDependencies": {
"stylelint": "^13.7.2"
}
Expand Down
3 changes: 2 additions & 1 deletion packages/varlet-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
},
"bugs": {
"url": "https://github.com/haoziqaq/varlet/issues"
}
},
"gitHead": "c0aed5bc04c05335b66607dbcab6455dafad1de4"
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3938,6 +3938,11 @@ core-js@^3.6.1:
resolved "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a"
integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==

core-js@^3.6.5:
version "3.6.5"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a"
integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==

[email protected], core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
Expand Down

0 comments on commit 128a0fa

Please sign in to comment.