本文整理匯總了TypeScript中@easy-webpack/config-css.config-css函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript config-css函數的具體用法?TypeScript config-css怎麽用?TypeScript config-css使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了config-css函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: envDev
/**
* Don't be afraid, you can put bits of standard Webpack configuration here
* (or at the end, after the last parameter, so it won't get overwritten by the presets)
* Because that's all easy-webpack configs are - snippets of premade, maintained configuration parts!
*
* For Webpack docs, see: https://webpack.js.org/configuration/
*/
ENV === 'test' || ENV === 'development' ?
envDev(ENV !== 'test' ? {} : {devtool: 'inline-source-map'}) :
envProd({ /* devtool: '...' */ }),
aurelia({root: rootDir, src: srcDir, title: title, baseUrl: baseUrl}),
typescript(ENV !== 'test' ? {} : { options: { doTypeCheck: false, sourceMap: false, inlineSourceMap: true, inlineSources: true } }),
html(),
css({ filename: 'styles.css', allChunks: true, sourceMap: false }),
fontAndImages(),
globalBluebird(),
generateIndexHtml({minify: ENV === 'production'}),
...(ENV === 'production' || ENV === 'development' ? [
commonChunksOptimize({appChunkName: 'app', firstChunk: 'aurelia-bootstrap'}),
copyFiles({patterns: [{ from: 'favicon.ico', to: 'favicon.ico' }]})
] : [
/* ENV === 'test' */
generateCoverage({ options: { esModules: true } })
]),
ENV === 'production' ?
uglify({debug: false, mangle: { except: ['cb', '__webpack_require__'] }}) : {}
);
示例2: easyCss
export = function less({ filename = '[name].css', allChunks = false, sourceMap = false, extractText = undefined, resolveRelativeUrl = undefined, additionalLoaders = [] } = {}) {
additionalLoaders.push(`less-loader${sourceMap ? '?sourceMap' : ''}`)
return easyCss({ test: /\.less$/i, filename, allChunks, extractText, resolveRelativeUrl, sourceMap, additionalLoaders })
}