本文整理汇总了TypeScript中webpack-stream.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: build
function build(name: string) {
var arr = name.split('/')
var filename = _.kebabCase(name.split('/')[0]) + '.js'
if (arr.length === 3) {
filename = _.kebabCase(name.split('/')[1]) + '.js'
}
var options: any = {
errorDetails: true,
debug: false,
output: {
filename: filename.toLowerCase()
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.js']
},
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.less$/, exclude: /node_modules/, loader: 'style!css!less' }
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({minimize: true})
]
}
return gulp.src('./' + name + '.js')
.pipe(webpackStream(options))
.pipe(gulp.dest('./public/assets/js'))
}
示例2:
export = () => {
return gulp.src([
'src/client/app/index.js',
'src/client/tests/entries/*.js',
'src/client/tests/entries/upload/upload.js' ])
.pipe(webpack(config))
.pipe(gulp.dest('dist/dev'));
};
示例3:
const streams = entriesAndSources.map(({ entry, name, sources }: IEntry): any =>
settings.gulp
.src(sources)
.pipe(sourcemaps.init())
.pipe(webpack({
entry,
externals,
output: {
library: name,
libraryTarget: "amd"
}
}))
.pipe(rename(`${name}.js`))
.pipe(uglify())
.pipe(sourcemaps.write("."))
.pipe(settings.gulp.dest(Constants.folders.dist)));
示例4:
gulp.task('webpack', ()=> {
return gulp.src('src/main.ts')
.pipe(webpack(require('../webpack.config.js')))
.pipe(gulp.dest('public/scripts'))
});
示例5:
export = () => {
return gulp.src('src/client/app/index.js')
.pipe(webpack(config))
.pipe(gulp.dest('dist/prod'));
};