Skip to content

Commit 15b1e1b

Browse files
committedOct 28, 2021
fix: set .mjs file type to javascript/auto
Fixes errors like: ``` Can't import the named export 'computed' from non EcmaScript module (only default export is available) ``` when using `pinia`.
1 parent f128c0c commit 15b1e1b

File tree

1 file changed

+8
-0
lines changed
  • packages/@vue/cli-service/lib/config

1 file changed

+8
-0
lines changed
 

‎packages/@vue/cli-service/lib/config/base.js

+8
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ module.exports = (api, options) => {
6666
webpackConfig.module
6767
.noParse(/^(vue|vue-router|vuex|vuex-router-sync)$/)
6868

69+
webpackConfig.module
70+
.rule('mjs')
71+
.test(/\.mjs$/)
72+
.include
73+
.add(/node_modules/)
74+
.end()
75+
.type('javascript/auto')
76+
6977
// js is handled by cli-plugin-babel ---------------------------------------
7078

7179
// vue-loader --------------------------------------------------------------

0 commit comments

Comments
 (0)
Please sign in to comment.