Skip to content

Commit

Permalink
fix: ensure <script> blocks in SFCs in node_modules are transpiled
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 27, 2018
1 parent 31b8feb commit 4bf56d7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions lib/webpack/createBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ module.exports = function createBaseConfig ({
if (filepath.startsWith(libDir)) {
return false
}
// always trasnpile js in vue files
if (/\.vue\.js$/.test(filepath)) {
return false
}
// Don't transpile node_modules
return /node_modules/.test(filepath)
}).end()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"toml": "^2.3.3",
"url-loader": "^1.0.1",
"vue": "^2.5.16",
"vue-loader": "^15.0.0-rc.1",
"vue-loader": "^15.0.4",
"vue-router": "^3.0.1",
"vue-server-renderer": "^2.5.16",
"vue-template-compiler": "^2.5.16",
Expand Down
21 changes: 14 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,14 @@
"@shellscape/koa-send" "^4.1.0"
debug "^2.6.8"

"@vue/component-compiler-utils@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-1.0.0.tgz#edcb00f656202c95091f07b0fe63a75e69b35614"
"@vue/component-compiler-utils@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-1.2.1.tgz#3d543baa75cfe5dab96e29415b78366450156ef6"
dependencies:
consolidate "^0.15.1"
hash-sum "^1.0.2"
lru-cache "^4.1.2"
merge-source-map "^1.1.0"
postcss "^6.0.20"
postcss-selector-parser "^3.1.1"
prettier "^1.11.1"
Expand Down Expand Up @@ -4042,6 +4043,12 @@ merge-options@^1.0.0:
dependencies:
is-plain-obj "^1.1"

merge-source-map@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646"
dependencies:
source-map "^0.6.1"

merge2@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.1.tgz#271d2516ff52d4af7f7b710b8bf3e16e183fef66"
Expand Down Expand Up @@ -6569,11 +6576,11 @@ vue-hot-reload-api@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.0.tgz#97976142405d13d8efae154749e88c4e358cf926"

vue-loader@^15.0.0-rc.1:
version "15.0.0-rc.2"
resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.0.0-rc.2.tgz#f7f71035912f67b9e0b52fbd51a4f9de5c7c0bfc"
vue-loader@^15.0.4:
version "15.0.4"
resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.0.4.tgz#309cc1ee6a438cabbbc79f8639890ce6cd9ba14c"
dependencies:
"@vue/component-compiler-utils" "^1.0.0"
"@vue/component-compiler-utils" "^1.2.1"
hash-sum "^1.0.2"
loader-utils "^1.1.0"
vue-hot-reload-api "^2.3.0"
Expand Down

0 comments on commit 4bf56d7

Please sign in to comment.