Reputation: 12413
I am trying to add custom tabs into my app. My plugin.json for the custom tabs as the following:
And my file structure looks as such:
But each time I navigate to a page, I get this error:
Am I doing something wrong?
Upvotes: 0
Views: 38
Reputation: 12413
As Mas pointed out, it has to be added to the webpack.confg.js is two locations:
In the entry:
entry: {
'control/content/content': [
path.join(__dirname, 'src/control/content/index.js')
],
'control/design/design': [
path.join(__dirname, 'src/control/design/index.js')
],
'control/settings/settings': [
path.join(__dirname, 'src/control/settings/index.js')
],
'control/security/security': [
path.join(__dirname, 'src/control/security/index.js')
],
'control/user/user': [
path.join(__dirname, 'src/control/user/index.js')
],
'widget/widget': [path.join(__dirname, 'src/widget/index.js')]
},
And the plugins:
WebpackConfig.plugins.push(
new HtmlWebpackPlugin({
filename: 'control/content/index.html',
minify: { removeComments: true, collapseWhitespace: true },
template: path.join(__dirname, 'src/control/content/index.html'),
chunks: ['control/content/content']
}),
new HtmlWebpackPlugin({
filename: 'control/design/index.html',
minify: { removeComments: true, collapseWhitespace: true },
template: path.join(__dirname, 'src/control/design/index.html'),
chunks: ['control/design/design']
}),
new HtmlWebpackPlugin({
filename: 'control/settings/index.html',
minify: { removeComments: true, collapseWhitespace: true },
template: path.join(__dirname, 'src/control/settings/index.html'),
chunks: ['control/settings/settings']
}),
new HtmlWebpackPlugin({
filename: 'control/security/index.html',
minify: { removeComments: true, collapseWhitespace: true },
template: path.join(__dirname, 'src/control/security/index.html'),
chunks: ['control/security/security']
}),
new HtmlWebpackPlugin({
filename: 'control/user/index.html',
minify: { removeComments: true, collapseWhitespace: true },
template: path.join(__dirname, 'src/control/user/index.html'),
chunks: ['control/user/user']
}),
new HtmlWebpackPlugin({
filename: 'widget/index.html',
minify: { removeComments: true, collapseWhitespace: true },
template: path.join(__dirname, 'src/widget/index.html'),
chunks: ['widget/widget']
})
Upvotes: 3