File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -141,3 +141,19 @@ export function getStyleLoaderUses(
141141
142142 return styleLoader ;
143143}
144+
145+ /**
146+ * Get resolved loader from @wpackio/scripts for your own usage.
147+ *
148+ * @param loader Webpack Loader.
149+ */
150+ export function getResolvedLoader ( loader : string ) {
151+ return require . resolve ( loader ) ;
152+ }
153+
154+ export const babelLoader = getResolvedLoader ( 'babel-loader' ) ;
155+ export const fileLoader = getResolvedLoader ( 'file-loader' ) ;
156+ export const cssLoader = getResolvedLoader ( 'css-loader' ) ;
157+ export const sassLoader = getResolvedLoader ( 'sass-loader' ) ;
158+ export const lessLoader = getResolvedLoader ( 'less-loader' ) ;
159+ export const postCssLoader = getResolvedLoader ( 'postcss-loader' ) ;
Original file line number Diff line number Diff line change @@ -46,6 +46,14 @@ export {
4646 issuerForStyleFiles ,
4747 issuerForJsTsFiles ,
4848 issuerForNonJsTsFiles ,
49+ getResolvedLoader ,
50+ babelLoader ,
51+ cssLoader ,
52+ fileLoader ,
53+ lessLoader ,
54+ getStyleLoaderUses ,
55+ postCssLoader ,
56+ sassLoader ,
4957} from './config/loaderHelpers' ;
5058
5159// Expose all needed script classes
You can’t perform that action at this time.
0 commit comments