Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is used as a placeholder, following the same pattern established in
// jest_config/globalMocks/fileMock.js

// It is used to help use properly overwrite the vuetify stylus files using webpack
// (see also webpack.config.js > webpack.NormalModuleReplacementPlugin())

'module-file-stub';
9 changes: 6 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const webpack = require('webpack');
const djangoProjectDir = path.resolve('contentcuration');
const staticFilesDir = path.resolve(djangoProjectDir, 'contentcuration', 'static');
const srcDir = path.resolve(djangoProjectDir, 'contentcuration', 'frontend');
const dummyModule = path.resolve(srcDir, 'shared', 'styles', 'modulePlaceholder.js')

const bundleOutputDir = path.resolve(staticFilesDir, 'studio');

Expand All @@ -42,6 +43,7 @@ module.exports = (env = {}) => {
exclude: dev ? [/./] : [/\.map$/, /^manifest.*\.js$/]
});


if (dev) {
// Suppress the "InjectManifest has been called multiple times" warning by reaching into
// the private properties of the plugin and making sure it never ends up in the state
Expand Down Expand Up @@ -115,9 +117,10 @@ module.exports = (env = {}) => {
modules: [rootNodeModules],
},
plugins: [
new webpack.IgnorePlugin({
resourceRegExp: /\.\.\/stylus\//,
}),
new webpack.NormalModuleReplacementPlugin(
/vuetify\/src\/stylus\//,
dummyModule
),
new BundleTracker({
filename: path.resolve(djangoProjectDir, 'build', 'webpack-stats.json'),
}),
Expand Down