Skip to content

Commit

Permalink
Updated webpack loader config
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioo committed Jan 24, 2023
1 parent f08bc03 commit e1bb0c1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
"sass": "^1.25.0",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-tracker": "^0.4.3"
"webpack-bundle-tracker": "^1.8.0"
}
}
46 changes: 26 additions & 20 deletions frontend/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@ var path = require('path')
var BundleTracker = require('webpack-bundle-tracker');

module.exports = {
publicPath: process.env.NODE_ENV === 'production'
? '/sitestatic/'
: 'http://localhost:8080/',
outputDir: '../modoboa_radicale/static/',
assetsDir: 'modoboa_radicale',
devServer: {
publicPath: 'http://localhost:8080/',
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers':
'X-Requested-With, content-type, Authorization',
'Access-Control-Allow-Credentials': 'true'
}
},
configureWebpack: config => {
config.plugins.push(new BundleTracker({
path: '../modoboa_radicale/static/modoboa_radicale/'
}));
}
publicPath: process.env.NODE_ENV === 'production'
? '/sitestatic/'
: 'http://localhost:8080/',
outputDir: '../modoboa_radicale/static/',
assetsDir: 'modoboa_radicale',
chainWebpack: config => {
config
.plugin('BundleTracker')
.use(BundleTracker, [{
filename: path.join('../modoboa_radicale/static/modoboa_radicale/', 'webpack-stats.json')
}])

config.devServer
.public('http://localhost:8080')
.port(8080)
.hotOnly(true)
.watchOptions({poll: 1000})
.https(false)
.headers({
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers':
'X-Requested-With, content-type, Authorization',
'Access-Control-Allow-Credentials': 'true'
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
{% block pagetitle %}{% trans "Calendar" %}{% endblock %}

{% block extra_css %}
{% render_bundle 'chunk-vendors' 'css' 'CALENDAR' %}
{% render_bundle 'app' 'css' 'CALENDAR' %}
{% endblock %}

{% block extra_js %}
{% render_bundle 'chunk-vendors' 'js' 'CALENDAR' %}
{% render_bundle 'app' 'js' 'CALENDAR' %}

<script>
Expand Down

0 comments on commit e1bb0c1

Please sign in to comment.