UNPKG

1.67 kBSource Map (JSON)View Raw
1{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAkBA,MAAM,UAAU,gBAAgB,CAC9B,IAAU,EACV,IAAiB,EACjB,aAA6B;IAE7B,IAAI,IAAI,KAAK,aAAa,EAAE;QAC1B,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;QACvD,MAAM,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QAC7D,OAAO,uBAAuB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;KACrD;SAAM,IAAI,IAAI,KAAK,YAAY,EAAE;QAChC,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;QAC3D,OAAO,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;KACpD;IACD,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["import { BundleOptions, ServiceOptions, ServiceType } from \"@excitare/cli-types\";\r\nimport webpack from \"webpack\";\r\n\r\nexport interface IConfiguration {\r\n entry: string;\r\n context: string;\r\n outputDir: string;\r\n outputName: string;\r\n name: string;\r\n rootDir: string;\r\n externals: string[];\r\n bundleOptions: BundleOptions;\r\n iconOptions?: ServiceOptions.Icon & {\r\n inputDir: string;\r\n };\r\n}\r\n\r\ntype Mode = \"development\" | \"production\";\r\nexport function configureWebpack(\r\n mode: Mode,\r\n type: ServiceType,\r\n configuration: IConfiguration\r\n): webpack.Configuration {\r\n if (mode === \"development\") {\r\n console.log(\"Configuring Webpack in development mode\");\r\n const { createDevelopmentConfig } = require(\"./development\");\r\n return createDevelopmentConfig(type, configuration);\r\n } else if (mode === \"production\") {\r\n const { createProductionConfig } = require(\"./production\");\r\n return createProductionConfig(type, configuration);\r\n }\r\n throw new Error(\"Unknown mode: \" + mode);\r\n}\r\n"]}
\No newline at end of file