Closed MichaelJCole closed 5 years ago
I figured out a working setup on my end and I am not sure this is a bug after all.
My solution was to use this in quasar.conf.js:
extendWebpack (cfg) {
// eslint errors in browser(?)
cfg.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /node_modules/,
options: {
formatter: require('eslint').CLIEngine.getFormatter('stylish')
}
})
// phaser wants files as URL's for XHR requests. refuses to load data urls
// exclude phaser assets from existing rules
cfg.module.rules.forEach(rule => {
try {
if (rule.use[0].loader === 'url-loader') {
rule.exclude = /src\/phaser/
}
} catch (e) {}
})
// Add rules for phaser assets
cfg.module.rules.push({
include: /src\/phaser/,
test: [/\.vert$/i, /\.frag$/i],
use: 'raw-loader'
},
{
include: /src\/phaser/,
test: /\.(gif|png|jpe?g|svg|xml|mp3|svg|woff|woff2)$/i,
use: 'file-loader'
}
)
}
},
See this repo: https://github.com/MichaelJCole/webpack-file-loader
Notes in these files: https://github.com/MichaelJCole/webpack-file-loader/search?q=ISSUE_HERE&unscoped_q=ISSUE_HERE
Expected Behavior
Actual Behavior
Code
This is
cfg.modules.rules
How Do We Reproduce?
See this repo: https://github.com/MichaelJCole/webpack-file-loader
Notes in these files: https://github.com/MichaelJCole/webpack-file-loader/search?q=ISSUE_HERE&unscoped_q=ISSUE_HERE