GitXplorerGitXplorer
r

cordova-webpack

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
b596a9b8bcff6a8fdd57b3252bd00beff9aee6d4

Bump dependencies

rremcohaszing committed 5 years ago
Verified
1e4eaac402d3f3d69a0c2f96c1c16fca275cc9f7

Bump dependencies

rremcohaszing committed 5 years ago
Verified
3c16e4e4ee6c88bfe65d4aa597d0f48db716615d

Bump dependencies

rremcohaszing committed 5 years ago
Verified
5587754adbfbd515945a6ac2e6075f93a7c729d1

Bump dependencies

rremcohaszing committed 6 years ago
Verified
26d9a57966486941501fbbabaa3fd49f9effe895

Bump dependencies

rremcohaszing committed 6 years ago
Verified
b881a87956e18d8c60286abe5a07561a888f690f

1.0.2

rremcohaszing committed 7 years ago

README

The README file for this repository.

cordova-webpack

Automate Webpack for Cordova based projects

build status

Installation

cordova-webpack can be installed using npm.

npm install cordova-webpack

Usage

Cordova configuration

Register the hook in config.xml.

<hook src="node_modules/cordova-webpack/hook.js" type="before_build" />
<hook src="node_modules/cordova-webpack/hook.js" type="before_emulate" />
<hook src="node_modules/cordova-webpack/hook.js" type="before_run" />

For more information, see Cordova hooks.

This will use your Webpack configuration file to build your project in the www directory.

By default this will use webpack.config.js, but it can be configured using the preference webpack-config in config.xml. The value is a path to a configuration file relative to the project root.

<preference name="webpack-config" value="webpack.config.js" />

Webpack configuration

Just like for the Webpack CLI, for this hook the configuration must expose a Webpack configuration object or a function which returns a Webpack configuration object.

Just like the Webpack CLI, if a function is exposed, it will be called with a webpack mode. Additionally the Cordova context is passed as cordova. env is always undefined.

module.exports = (env, {
  mode,     // 'development' or 'production'
  cordova,  // Cordova context
}) => {
  // Return Webpack configuration
};

For a reference for the cordova object, see Cordova hook context

By default the devtool option is set to false for release builds, and 'inline-source-map' for debug builds.

The output path is always set to www and the ProgressPlugin is always included.