File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed
packages/shared/plugin-less-copy Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 11// import { fileURLToPath, URL } from 'url'
22
3- import resolve from '@rollup/plugin-node-resolve'
4- import typescript from '@rollup/plugin-typescript'
5- import commonjs from '@rollup/plugin-commonjs'
3+ import resolve from '@rollup/plugin-node-resolve' ;
4+ import typescript from '@rollup/plugin-typescript' ;
5+ import commonjs from '@rollup/plugin-commonjs' ;
66
7- import pkg from './package.json'
7+ import pkg from './package.json' ;
88
99export default {
1010 input : 'src/index.ts' ,
@@ -21,4 +21,4 @@ export default {
2121 sourceMap : false ,
2222 } ) ,
2323 ] ,
24- }
24+ } ;
Original file line number Diff line number Diff line change 1- import { resolve } from 'path'
2- import { normalizePath , type Plugin } from 'vite'
1+ import { resolve } from 'path' ;
2+ import { normalizePath , type Plugin } from 'vite' ;
33
4- const excludeRegx = / n o d e _ m o d u l e s /
4+ const excludeRegx = / n o d e _ m o d u l e s / ;
55
66function createPlugin ( ) : Plugin {
7- const maps = new Map < string , string > ( )
8- const srcDir = normalizePath ( resolve ( './src/' ) )
7+ const maps = new Map < string , string > ( ) ;
8+ const srcDir = normalizePath ( resolve ( './src/' ) ) ;
99
1010 return {
1111 name : 'vite-plugin-less-copy' ,
1212 enforce : 'pre' ,
1313 apply : 'build' ,
1414 transform ( code : string , id : string ) {
1515 if ( ! id . endsWith ( '.less' ) || excludeRegx . test ( id ) ) {
16- return
16+ return ;
1717 }
1818
19- maps . set ( id , code )
20- return code
19+ maps . set ( id , code ) ;
20+ return code ;
2121 } ,
2222
2323 generateBundle ( ) {
2424 maps . forEach ( ( code , file ) => {
25- const filename = file . replace ( srcDir , '' ) . substring ( 1 )
25+ const filename = file . replace ( srcDir , '' ) . substring ( 1 ) ;
2626 this . emitFile ( {
2727 type : 'asset' ,
2828 fileName : filename ,
2929 source : code ,
30- } )
31- } )
30+ } ) ;
31+ } ) ;
3232 } ,
33- }
33+ } ;
3434}
3535
36- export default createPlugin
36+ export default createPlugin ;
You can’t perform that action at this time.
0 commit comments