yumechi-no-kuni/webpack/module/rules/license.ts

18 lines
379 B
TypeScript
Raw Normal View History

2017-12-10 12:38:31 -06:00
/**
* Inject license
*/
const StringReplacePlugin = require('string-replace-webpack-plugin');
2017-12-31 11:08:41 -06:00
import { licenseHtml } from '../../../src/common/build/license';
2017-12-10 12:38:31 -06:00
export default () => ({
enforce: 'pre',
test: /\.(tag|js)$/,
exclude: /node_modules/,
loader: StringReplacePlugin.replace({
replacements: [{
2017-12-31 11:08:41 -06:00
pattern: '%license%', replacement: () => licenseHtml
2017-12-10 12:38:31 -06:00
}]
})
});