Skip to content

Commit ba01735

Browse files
committed
feat(icongenie): support for upcoming @quasar/app-vite generated projects
1 parent 36aa737 commit ba01735

File tree

5 files changed

+15
-19
lines changed

5 files changed

+15
-19
lines changed

app-vite/lib/create-vite-config.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ module.exports = function (quasarConf, quasarRunMode) {
8888
clearScreen: false,
8989
logLevel: 'warn',
9090
mode: ctx.dev === true ? 'development' : 'production',
91-
cacheDir: appPaths.resolve.app(
92-
'node_modules/.cache/vite/'
93-
+ (quasarRunMode || quasarConf.ctx.modeName)
94-
),
91+
cacheDir: `node_modules/.vite/${ quasarRunMode || quasarConf.ctx.modeName }`,
9592

9693
resolve: build.resolve,
9794
define: parseEnv(build.env, build.rawDefine),
@@ -100,7 +97,7 @@ module.exports = function (quasarConf, quasarRunMode) {
10097
target: quasarRunMode === 'ssr-server'
10198
? build.target.node
10299
: build.target.browser,
103-
polyfillModulePreload: false,
100+
polyfillModulePreload: build.polyfillModulePreload,
104101
emptyOutDir: false,
105102
sourcemap: build.sourcemap === true
106103
? 'inline'
@@ -132,7 +129,8 @@ module.exports = function (quasarConf, quasarRunMode) {
132129
'reportCompressedSize',
133130
'chunkSizeWarningLimit',
134131
'assetsInlineLimit',
135-
'cssCodeSplit'
132+
'cssCodeSplit',
133+
'assetsDir'
136134
])
137135

138136
if (

app-vite/lib/helpers/app-files-validations.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ module.exports = function (cfg) {
99
let content
1010
let error = false
1111

12-
file = appPaths.resolve.app(cfg.build.htmlFilename)
12+
file = appPaths.resolve.app('index.html')
1313
content = fs.readFileSync(file, 'utf-8')
1414

1515
if (content.indexOf(attachMarkup) !== -1) {
1616
warn(`Please remove ${ attachMarkup } from
17-
/${ cfg.build.htmlFilename } inside of <body>\n`)
17+
/index.html inside of <body>\n`)
1818
error = true
1919
}
2020

2121
if (content.indexOf(entryPointMarkup) === -1) {
2222
warn(`Please add ${ entryPointMarkup } to
23-
/${ cfg.build.htmlFilename } inside of <body>\n`)
23+
/index.html inside of <body>\n`)
2424
error = true
2525
}
2626

app-vite/lib/quasar-conf-file.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ class QuasarConfFile {
409409
},
410410

411411
vueOptionsAPI: true,
412+
polyfillModulePreload: false,
413+
distDir: path.join('dist', this.ctx.modeName),
412414

413415
rawDefine: {
414416
// vue
@@ -436,8 +438,6 @@ class QuasarConfFile {
436438

437439
productName: appPkg.productName,
438440
productDescription: appPkg.description,
439-
distDir: path.join('dist', this.ctx.modeName),
440-
htmlFilename: 'index.html',
441441
ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
442442
// will mess up SSR
443443
vueRouterMode: 'hash',
@@ -458,7 +458,6 @@ class QuasarConfFile {
458458
}
459459
else if (this.ctx.mode.cordova || this.ctx.mode.capacitor || this.ctx.mode.electron || this.ctx.mode.bex) {
460460
Object.assign(cfg.build, {
461-
htmlFilename: 'index.html',
462461
vueRouterMode: 'hash'
463462
})
464463
}
@@ -617,11 +616,7 @@ class QuasarConfFile {
617616
}
618617

619618
if (this.ctx.dev) {
620-
const urlPath = cfg.build.vueRouterMode === 'hash'
621-
? (cfg.build.htmlFilename !== 'index.html' ? (cfg.build.publicPath ? '' : '/') + cfg.build.htmlFilename : '')
622-
: ''
623-
624-
const getUrl = hostname => `http${cfg.devServer.https ? 's' : ''}://${hostname}:${cfg.devServer.port}${cfg.build.publicPath}${urlPath}`
619+
const getUrl = hostname => `http${cfg.devServer.https ? 's' : ''}://${hostname}:${cfg.devServer.port}${cfg.build.publicPath}`
625620
const hostname = cfg.devServer.host === '0.0.0.0'
626621
? 'localhost'
627622
: cfg.devServer.host

icongenie/lib/mount/mount-tag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports.mountTag = function mountTag (files) {
88
}
99

1010
console.log()
11-
log(`You will need the following tags in your /src/index.template.html:\n`)
11+
log(`You will need the following tags in your /index.html or /src/index.template.html:\n`)
1212
tagFiles.forEach(file => {
1313
console.log(file.tag)
1414
})

icongenie/lib/utils/app-paths.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ function getAppDir () {
55
let dir = process.cwd()
66

77
while (dir.length && dir[dir.length - 1] !== sep) {
8-
if (existsSync(join(dir, 'quasar.conf.js'))) {
8+
if (
9+
existsSync(join(dir, 'quasar.conf.js')) ||
10+
existsSync(join(dir, 'quasar.config.js'))
11+
) {
912
return dir
1013
}
1114

0 commit comments

Comments
 (0)