mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-18 10:51:10 +00:00
ea2bcd44f2
- Update package.json with the new dependencies. - A script storybook.sh pulls down CSS and LESS imports from external dependencies. This copies the approach taken in Popups and MobileFrontend. - Icons from external repos are maintained within the repo in SVG-only form. Using load.php modules is also possible, but will pull down other unnecessary icons and break if any of these modules are changed. Decided that we should manually maintain these for the time being given there are only 3 icons. - Several LESS files now import the variables file. I think it's useful for stories to only import the CSS they use as this encourages us to modularise our CSS. Before these imports were not necessary as they inherit imports from index.less. This will have no impact on the bundle size as the LESS compiler silently discards duplicate imports - stories/utils.js provides a useful placeholder function for generalising our hook entry points. Bug: T242674 Change-Id: I722e84d2fb57653a2f96142dc3e5248043261746
55 lines
963 B
JavaScript
55 lines
963 B
JavaScript
const path = require( 'path' );
|
|
|
|
module.exports = {
|
|
module: {
|
|
rules: [ {
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
// Beware of https://github.com/babel/babel-loader/issues/690. Changes to browsers require
|
|
// manual invalidation.
|
|
cacheDirectory: true
|
|
}
|
|
}
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [ {
|
|
loader: 'style-loader'
|
|
}, {
|
|
loader: 'css-loader'
|
|
} ]
|
|
},
|
|
{
|
|
test: /\.(gif|png|jpe?g|svg)$/i,
|
|
issuer: /\.less$/,
|
|
loader: 'file-loader',
|
|
options: {
|
|
paths: [
|
|
path.resolve( __dirname, 'components/images' )
|
|
]
|
|
}
|
|
},
|
|
{
|
|
// in core some LESS imports don't specify filename
|
|
test: /\.less$/,
|
|
use: [ {
|
|
loader: 'style-loader'
|
|
}, {
|
|
loader: 'css-loader'
|
|
}, {
|
|
loader: 'less-loader',
|
|
options: {
|
|
relativeUrls: false,
|
|
paths: [
|
|
path.resolve( __dirname, 'resolve-less-imports' )
|
|
]
|
|
}
|
|
} ]
|
|
},
|
|
]
|
|
}
|
|
};
|