2018-12-12 23:08:38 +00:00
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
module: {
|
2019-09-04 17:49:22 +00:00
|
|
|
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'
|
|
|
|
} ]
|
|
|
|
},
|
|
|
|
{
|
2018-12-12 23:08:38 +00:00
|
|
|
test: /\.less$/,
|
|
|
|
use: [{
|
|
|
|
loader: 'style-loader'
|
|
|
|
}, {
|
|
|
|
loader: 'css-loader'
|
|
|
|
}, {
|
|
|
|
loader: 'less-loader',
|
|
|
|
options: {
|
|
|
|
paths: [
|
2019-09-04 17:49:22 +00:00
|
|
|
path.resolve( __dirname, 'mocks' )
|
2018-12-12 23:08:38 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.svg$/,
|
|
|
|
issuer: /\.less$/,
|
|
|
|
loader: 'url-loader'
|
|
|
|
},
|
2019-12-12 21:57:19 +00:00
|
|
|
{
|
|
|
|
test: /\.jpg$/,
|
|
|
|
loader: 'url-loader'
|
|
|
|
},
|
2018-12-12 23:08:38 +00:00
|
|
|
{
|
|
|
|
test: /\.svg$/,
|
|
|
|
loader: 'svg-inline-loader',
|
|
|
|
issuer: /\.js$/,
|
|
|
|
options: {
|
|
|
|
removeSVGTagAttrs: false // Keep width and height attributes.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: [ '.js' ]
|
2019-09-04 17:49:22 +00:00
|
|
|
}
|
2018-12-12 23:08:38 +00:00
|
|
|
};
|