Skip to content

Commit 75a6b22

Browse files
committed
Fix HMR
1 parent 5f5bd7a commit 75a6b22

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

vue.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ class TailwindExtractor {
3333

3434
module.exports = {
3535
runtimeCompiler: true,
36-
baseUrl: '/',
36+
baseUrl: process.env.NODE_ENV === 'production'
37+
? '/'
38+
: `${config.https ? 'https' : 'http'}://${config.host}:${config.port}/`,
3739
outputDir: 'web/dist',
3840
filenameHashing: process.env.NODE_ENV === 'production' ? true : false,
3941
css: {
@@ -44,6 +46,7 @@ module.exports = {
4446
// host: config.host,
4547
// port: config.port,
4648
https: config.https,
49+
headers: { 'Access-Control-Allow-Origin': '*' },
4750
before(app, server) {
4851
const sane = require('sane')
4952
var watcher = sane(path.join(__dirname, config.watchDir), {glob: ['**/*']});
@@ -84,4 +87,4 @@ module.exports = {
8487
config.plugins.delete('preload')
8588
config.plugins.delete('prefetch')
8689
}
87-
}
90+
}

0 commit comments

Comments
 (0)