mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
dbb58da86b
This removes the webpack.config.js file, moving the webpack config into main.js, which replaces config.js. - Moves the global jQuery into the webpack config in main.js. - Removes the outdates .nvmrc file in the webpack folder. - Moves the mockMediaWiki initialization from config.js into index.stories.js - Upgrades webpack to 4.22.2 Bug: T271763 Change-Id: Ie008d69e992625113ae98d52ad6d37186eb933de
55 lines
1 KiB
JavaScript
55 lines
1 KiB
JavaScript
const path = require("path");
|
|
const webpack = require( "webpack" );
|
|
|
|
module.exports = {
|
|
stories: ['./stories/*.stories.js' ],
|
|
webpackFinal: async (config, { configType }) => {
|
|
config.module.rules.push({
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader']
|
|
});
|
|
config.module.rules.push({
|
|
test: /\.less$/,
|
|
use: ['style-loader', 'css-loader', {
|
|
loader: 'less-loader',
|
|
options: {
|
|
paths: [
|
|
path.resolve( __dirname, 'mocks' )
|
|
]
|
|
}
|
|
}]
|
|
});
|
|
|
|
config.module.rules.push({
|
|
test: /\.svg$/,
|
|
issuer: /\.less$/,
|
|
loader: 'url-loader'
|
|
});
|
|
|
|
config.module.rules.push({
|
|
test: /\.svg$/,
|
|
loader: 'svg-inline-loader',
|
|
issuer: /\.js$/,
|
|
options: {
|
|
removeSVGTagAttrs: false // Keep width and height attributes.
|
|
}
|
|
});
|
|
|
|
config.module.rules.push({
|
|
test: /\.jpg$/,
|
|
loader: 'url-loader'
|
|
});
|
|
|
|
config.resolve.extensions.push( '.js' );
|
|
|
|
config.plugins.push(
|
|
new webpack.ProvidePlugin({
|
|
$: "jquery",
|
|
jQuery: "jquery"
|
|
})
|
|
);
|
|
|
|
return config;
|
|
}
|
|
};
|