(is_dev: boolean)
| 17 | const entry_index_noop_filename = path.join(src_dirname, `index_noop.ts`) |
| 18 | |
| 19 | function clean_css_plugin(is_dev: boolean): esb.Plugin { |
| 20 | return { |
| 21 | name: 'custom', |
| 22 | setup(build) { |
| 23 | if (is_dev) return |
| 24 | |
| 25 | // minify css during build |
| 26 | build.onLoad({filter: /\.css$/}, async args => { |
| 27 | const file = await fsp.readFile(args.path) |
| 28 | const css = await esb.transform(file, {loader: "css", minify: true}) |
| 29 | return {loader: "text", contents: css.code} |
| 30 | }) |
| 31 | }, |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | |
| 36 | export default () => { |
no outgoing calls
no test coverage detected
searching dependent graphs…