mirror of
https://github.com/liriliri/eruda.git
synced 2026-02-02 09:49:00 +08:00
chore: move build scripts into build folder
This commit is contained in:
12
build/loaders/css-minifier-loader.js
Normal file
12
build/loaders/css-minifier-loader.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const cssMap = require('../../src/lib/cssMap')
|
||||
const escapeRegExp = require('licia/escapeRegExp')
|
||||
const each = require('licia/each')
|
||||
|
||||
module.exports = function (src) {
|
||||
each(cssMap, (val, key) => {
|
||||
src = src.replace(new RegExp(escapeRegExp(';' + key + ':'), 'g'), ';$' + val + ':')
|
||||
src = src.replace(new RegExp(escapeRegExp('{' + key + ':'), 'g'), '{$' + val + ':')
|
||||
})
|
||||
|
||||
return src
|
||||
}
|
||||
3
build/loaders/handlebars-minifier-loader.js
Normal file
3
build/loaders/handlebars-minifier-loader.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = function (src) {
|
||||
return src.replace(/"loc":\{"start":\{"line":\d+,"column":\d+},"end":\{"line":\d+,"column":\d+\}\}/g, '')
|
||||
}
|
||||
Reference in New Issue
Block a user