I have the following vue.config.js file:
const fs = require('fs');
const util = require('util');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
const path = require('path');
const vtkChainWebpack = require('vtk.js/Utilities/config/chainWebpack');
const packageJson = require('./package.json');
const stat = util.promisify(fs.stat);
module.exports = {
devServer: {
port: 8081,
public: process.env.PUBLIC_ADDRESS,
},
lintOnSave: false,
publicPath: process.env.VUE_APP_STATIC_PATH,
configureWebpack: {
devtool: 'eval-source-map',
plugins: [
new CopyPlugin({
patterns: [
{
from: path.join(__dirname, 'node_modules', 'itk'),
to: 'itk',
filter: async (resourcePath) => {
const resourceStats = await stat(resourcePath);
const resourceSize = resourceStats.size;
return resourceSize <= (25 * 1024 * 1024);
},
},
],
}),
new webpack.DefinePlugin({
'process.env': {
VERSION: JSON.stringify(packageJson.version),
},
}),
],
performance: {
maxEntrypointSize: 4000000,
maxAssetSize: 40000000,
},
},
chainWebpack: (config) => {
vtkChainWebpack(config);
},
};
It provides an object for configureWebpack. I've tried changing it to use an arrow function like so:
configureWebpack: config => {
config.devtool = 'eval-source-map';
config.plugins = [
new CopyPlugin({
patterns: [
{
from: path.join(__dirname, 'node_modules', 'itk'),
to: 'itk',
filter: async (resourcePath) => {
const resourceStats = await stat(resourcePath);
const resourceSize = resourceStats.size;
return resourceSize <= (25 * 1024 * 1024);
},
},
],
}),
new webpack.DefinePlugin({
'process.env': {
VERSION: JSON.stringify(packageJson.version),
},
}),
];
config.performance = {
maxEntrypointSize: 4000000,
maxAssetSize: 40000000,
};
},
chainWebpack: (config) => {
vtkChainWebpack(config);
},
};
When I run npm run serve (same as vue-cli-service serve) it starts webpack but then seems to hang indefinitely without displaying any of the usual messaging regarding bundling.
If I eventually try visiting the site it throws an error about being unable to parse a param for the favicon.ico. What am I missing? Thanks!