2020-01-09 22:11:00 +00:00
|
|
|
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,
|
2020-10-16 22:27:43 +00:00
|
|
|
loader: 'file-loader',
|
2020-01-09 22:11:00 +00:00
|
|
|
options: {
|
|
|
|
paths: [
|
2020-09-24 12:15:37 +00:00
|
|
|
path.resolve( __dirname, './resolve-imports' )
|
2020-01-09 22:11:00 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// in core some LESS imports don't specify filename
|
|
|
|
test: /\.less$/,
|
|
|
|
use: [ {
|
|
|
|
loader: 'style-loader'
|
|
|
|
}, {
|
|
|
|
loader: 'css-loader'
|
|
|
|
}, {
|
|
|
|
loader: 'less-loader',
|
|
|
|
options: {
|
|
|
|
relativeUrls: false,
|
2020-10-16 22:27:43 +00:00
|
|
|
strictUnits: true,
|
2020-01-09 22:11:00 +00:00
|
|
|
paths: [
|
2020-09-24 12:15:37 +00:00
|
|
|
path.resolve( __dirname, 'resolve-imports' )
|
2020-01-09 22:11:00 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
} ]
|
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|