nl_tokens: / * eslint - disable - next - line no - shadow
pl_tokens: function createConfig ( options , legacy ) { return { entry : Array . isArray ( options . <mask> ) ? options . entry : [ options . entry ] , output : { filename : ` ${ legacy ? 'legacy/' : '' } ` , chunkFilename : ` ${ legacy ? 'legacy/' : '' } ` , path : path . resolve ( process . cwd ( ) , ` ` ) , } , devtool : development ? 'inline-source-map' : 'source-map' , resolve : { mainFields : [ // current leading de-facto standard - see https://github.com/rollup/rollup/wiki/pkg.module 'module' , // previous de-facto standard, superceded by `module`, but still in use by some packages 'jsnext:main' , // standard package.json fields 'browser' , 'main' , ] , } , module : { rules : [ { test : / \.js$|\.ts$ / , use : { loader : 'babel-loader' , options : { plugins : [ '@babel/plugin-syntax-dynamic-import' , '@babel/plugin-syntax-import-meta' , ! development && [ 'template-html-minifier' , { modules : { 'lit-html' : [ 'html' ] , 'lit-element' : [ 'html' , { name : 'css' , encapsulation : 'style' } ] , } , htmlMinifier : { collapseWhitespace : true , removeComments : true , caseSensitive : true , } , } , ] , // webpack does not support import.meta.url yet, so we rewrite them in babel [ 'bundled-import-meta' , { importStyle : 'baseURI' } ] , ] . filter ( _ => ! ! _ ) , presets : [ [ '@babel/preset-env' , // hardcode IE11 for legacy build, otherwise use browserslist configuration { targets : legacy ? 'IE 11' : findSupportedBrowsers ( ) } , ] , ] , } , } , } , options . htmlEntryPoint && { test : options . input , loader : require . resolve ( './src/clean-up-html-loader.js' ) , } , ] . filter ( _ => ! ! _ ) , } , optimization : { minimizer : [ ! development && new TerserPlugin ( { terserOptions : { output : { comments : false , } , } , parallel : true , sourceMap : true , } ) , ] . filter ( _ => ! ! _ ) , } , plugins : [ // @ts-ignore ! development && new CleanWebpackPlugin ( ) , new HtmlWebpackPlugin ( { template : options . indexHTML , inject : false , } ) , modernWebWebpackPlugin , ] . filter ( _ => ! ! _ ) , devServer : { contentBase : process . cwd ( ) , compress : true , port : 8080 , historyApiFallback : false , stats : { stats : 'errors-only' , } , } , } ; }