Closed iwalucas closed 3 years ago
@iwalucas can you post your full webpack config + the generated manifest file?
I am using vue-cli... here is the config file
const BundleTracker = require("webpack-bundle-tracker");
module.exports = {
publicPath: process.env.NODE_ENV === 'production'
? 'https://mycoolurl/static/'
: 'http://localhost:8080',
outputDir: './dist/',
chainWebpack: config => {
config.optimization
.splitChunks(false)
config
.plugin('BundleTracker')
.use(BundleTracker, [{filename: '../frontend/webpack-stats.json'}])
config.resolve.alias
.set('__STATIC__', 'static')
config.devServer
.public('http://0.0.0.0:8080')
.host('0.0.0.0')
.port(8080)
.hotOnly(true)
.watchOptions({poll: 1000})
.https(false)
.headers({"Access-Control-Allow-Origin": ["\*"]})
},
pages: {
page1: 'src/page1.js',
page2:'src/page2.js'
}
};
the manifest is the webpack-stats?
@iwalucas You're on the right track with the vue config you have. The plugin you're using to generate the manifest file (in your case "webpack-stats") is not the plugin that works with django-manifest-loader
out of the box.
1) If your manifest file is not named manifest.json
then you need to let Django Manifest Loader know about that in the settings
2) If you want to use the webpack-bundle-tracker
plugin to generate your manifest file, then you'll need to write a custom loader to parse through it. Details are in the docs.
3) In order to get up and running without having to do the above, you need to use webpack-manifest-plugin
to generate your manifest file.
happy to answer any questions you have about that
First, great project!
For some reason, the
manifest
is not picking correctly the URL from my webpack-stats: