mediawiki-extensions-Popups/.storybook/webpack.config.js
jdlrobson 1803ac5b2d Storybook: Images should be relative uris
Follow up to I58493db15b27f148fcc1cf42ab0b0148ee291eb6

Bug: T236589
Change-Id: I305badda5a3f93684270bfe07d6cc19c92df3e07
2019-12-13 01:42:13 +00:00

64 lines
1.1 KiB
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: /\.less$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader'
}, {
loader: 'less-loader',
options: {
paths: [
path.resolve( __dirname, 'mocks' )
]
}
}],
},
{
test: /\.svg$/,
issuer: /\.less$/,
loader: 'url-loader'
},
{
test: /\.jpg$/,
loader: 'url-loader'
},
{
test: /\.svg$/,
loader: 'svg-inline-loader',
issuer: /\.js$/,
options: {
removeSVGTagAttrs: false // Keep width and height attributes.
}
}
]
},
resolve: {
extensions: [ '.js' ]
}
};