0.3.4 • Published 3 years ago

haste-task-webpack v0.3.4

Weekly downloads
937
License
MIT
Repository
-
Last release
3 years ago

haste-task-webpack

webpack wrapper for haste runner.

options

configPath

Type: string

Path to a webpack config, the config can be a javascript object or a function that accepts an object of config params and return an object.

// ./webpack.config.js

module.exports = {
  entry: './index.js',
  output: {
    path: 'dist',
    filename: 'bundle.js',
  }
};

Useful when you want to build your webpack config dynamically using cli arguments or configuration from the preset.

// ./webpack.config.function.js

module.exports = configParams => ({
  entry: configParams.entry,
  output: {
    path: 'dist',
    filename: 'bundle.js',
  }
});

callbackPath

Type: string

Path to a callback that accepts webpack err and stats, for example:

module.exports = (err, stats) => {
  console.log(stats.toString('minimal'));
};

configParams

Type: object

An object that will be passed to the config function in case it is actually a function.

// ./preset.js

webpack({ configPath: './webpack.config.function', configParams: { hey: 'oh'}});

// ./webpack.config.function.js

module.exports = configParams => {
  console.log(configParams.hey) // oh

  return ({
    entry: './index.js',
    output: {
      path: 'dist',
      filename: 'bundle.js',
    }
  })
};

watch

Type: boolean

Whether or not to run Webpack in watch mode, defaults to false.

watchOptions

Type: object

Watch options for webpack, see webpack documentation for the full list of available options.

statsFilename

Type: string

If set, will generate a webpack stats file in the given location, by default no file is generated.

0.3.4

3 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.8

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.19

6 years ago

0.1.18

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.10

6 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.4

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago