Skip to content

Commit a017815

Browse files
committed
fix(app-webpack): compatibility issue with newer q/extras
1 parent e1331e5 commit a017815

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

app-webpack/lib/webpack/create-chain.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const { VueLoaderPlugin } = require('vue-loader')
77
const WebpackProgressPlugin = require('./plugin.progress')
88
const BootDefaultExport = require('./plugin.boot-default-export')
99
const parseBuildEnv = require('../helpers/parse-build-env')
10+
const getPackagePath = require('../helpers/get-package-path')
1011

1112
const appPaths = require('../app-paths')
1213
const injectStyleRules = require('./inject.style-rules')
@@ -38,6 +39,13 @@ function getRootDefines (rootDefines, configName) {
3839
return rootDefines
3940
}
4041

42+
const extrasPath = (() => {
43+
const ePath = getPackagePath('@quasar/extras')
44+
return ePath !== void 0
45+
? path.dirname(ePath)
46+
: false
47+
})()
48+
4149
module.exports = function (cfg, configName) {
4250
const chain = new WebpackChain()
4351

@@ -91,6 +99,11 @@ module.exports = function (cfg, configName) {
9199
'src-bex': appPaths.bexDir // needed for app/templates
92100
})
93101

102+
if (extrasPath) {
103+
// required so quasar/icon-sets/* with imports to work correctly
104+
chain.resolve.alias.merge({ '@quasar/extras': extrasPath })
105+
}
106+
94107
const vueFile = configName === webpackNames.ssr.serverSide
95108
? (cfg.ctx.prod ? 'vue.cjs.prod.js' : 'vue.cjs.js')
96109
: (

extras/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// empty file
2+
// to help q/app-webpack discover where this package is installed

0 commit comments

Comments
 (0)