當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript webpack-stream.default函數代碼示例

本文整理匯總了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'))
}
開發者ID:starlying,項目名稱:projs,代碼行數:29,代碼來源:pack.ts

示例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'));
};
開發者ID:mapkiwiz,項目名稱:sectorisation,代碼行數:8,代碼來源:webpack.dev.ts

示例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)));
開發者ID:FullScreenShenanigans,項目名稱:gulp-shenanigans,代碼行數:16,代碼來源:webpack.ts

示例4:

 gulp.task('webpack', ()=> {
   return gulp.src('src/main.ts')
   .pipe(webpack(require('../webpack.config.js')))
   .pipe(gulp.dest('public/scripts'))
 });
開發者ID:stolpnik,項目名稱:angular2-test,代碼行數:5,代碼來源:webpack.ts

示例5:

export = () => {
  return gulp.src('src/client/app/index.js')
    .pipe(webpack(config))
    .pipe(gulp.dest('dist/prod'));
};
開發者ID:mapkiwiz,項目名稱:sectorisation,代碼行數:5,代碼來源:webpack.prod.ts


注:本文中的webpack-stream.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。