1.0.0 • Published 8 years ago

cripweb-webpack v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

cripweb-webpack

CripWeb extension to use with webpack

Configurations

For configuration you can use cripweb configuration module. Default configuration definition:

{
  webpack: {
    base: '',
    output: '{assetsDist}',
    config: {},
    isInDefaults: true
  }
}

Sample of usage

var gulp = require('gulp');
var cripweb = require('cripweb');
var cripwebWebpack = require('cripweb-webpack');

// define your own webpack config or require existing one by `require('./webpack.config.js')`
var webpack_config = {
  entry: './assets/src/index.tsx',
  ...
};

cripweb(gulp)(function (crip) {
  // define external crip plugin for webpack
  crip.define('webpack', cripWebpack);

  // now you have available webpack configuration
  crip.config.set('webpack', {
    output: '{assetsDist}\\js',
    config: webpack_config
  });
  
  // now we can define our webpack configuration
  crip.webpack('typescripts', 'assets/src/**/*.tsx');
});

Definition webpack(taskName, globs [ , webpackConfig, outputPath , prependPath ])

taskName

Type: string

Task name for gulp output. Will be prefixed with webpack- to be unique in gulp.

globs

Type: string or array

Glob or array of globs to be read and listenned on watch-globs task.

webpackConfig

Type: object

Webpack configuration file.

outputPath

Type: string

Location where webpack output files will be located.

prependPath

Type: string

The place where patterns starting with / will be mounted onto globs items. By default is used configuration webpack.base value (empty string).