import * as qs from 'querystring' ; import webpack = require ( 'webpack' ) ; import { compileStyle } from 'vue/compiler-sfc' ; const StylePostLoader = function ( source , inMap ) { const query = qs . parse ( this . resourceQuery . slice ( 1 ) ) ; const { code , map , errors } = compileStyle ( { source : source as string , filename : this . resourcePath , id : `data-v-${ query . id }` , map : inMap , scoped : ! ! query . scoped , trim : true , isProd : this . mode === 'production' || process . env . NODE_ENV === 'production' , } ) ; if ( errors . length ) { this . callback ( errors [ 0 ] ) ; } else { this . callback ( null , code , map ) ; } } ; export default StylePostLoader ;