mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-25 07:56:40 +00:00
4eb9c0efa8
- Add SVG Inline Loader for Webpack. This allows SVG files to be imported. - Update the Webpack and test configurations to use the new loader. - Scope the ESLint rules down to just JavaScript files so that linting isn't attempted on the SVG. Bug: T165036 Change-Id: I00bccff4c3167975c19d577be6343dcaca7ddb2d
22 lines
459 B
JavaScript
22 lines
459 B
JavaScript
#!/usr/bin/env node
|
|
const fs = require( 'fs' ),
|
|
svgInlineLoader = require( 'svg-inline-loader' );
|
|
|
|
require( 'babel-register' )( {
|
|
presets: [
|
|
[ 'env', {
|
|
targets: {
|
|
node: 6
|
|
}
|
|
} ]
|
|
]
|
|
} );
|
|
|
|
require.extensions[ '.svg' ] = ( module, filename ) => {
|
|
const svg = fs.readFileSync( filename, { encoding: 'utf8' } );
|
|
// eslint-disable-next-line no-underscore-dangle
|
|
module._compile( svgInlineLoader( svg ), filename );
|
|
};
|
|
|
|
require( 'mw-node-qunit' );
|