4.5.1 • Published 6 years ago

write-file-webpack-plugin v4.5.1

Weekly downloads
197,903
License
BSD-3-Clause
Repository
github
Last release
6 years ago

write-file-webpack-plugin

NPM version js-canonical-style

Forces webpack-dev-server program to write bundle files to the file system.

This plugin has no effect when webpack program is used instead of webpack-dev-server.

Install

npm install write-file-webpack-plugin --save-dev

API

/**
 * @typedef {Object} options
 * @property {boolean} atomicReplace Atomically replace files content (i.e., to prevent programs like test watchers from seeing partial files) (default: true).
 * @property {boolean} exitOnErrors Stop writing files on webpack errors (default: true).
 * @property {boolean} force Forces the execution of the plugin regardless of being using `webpack-dev-server` or not (default: false).
 * @property {boolean} log Logs names of the files that are being written (or skipped because they have not changed) (default: true).
 * @property {RegExp} test A regular expression used to test if file should be written. When not present, all bundle will be written.
 * @property {boolean} useHashIndex Use hash index to write only files that have changed since the last iteration (default: true).
 */

/**
 * @param {options} options
 * @returns {Object}
 */
new WriteFilePlugin();

new WriteFilePlugin({
    // Write only files that have ".css" extension.
    test: /\.css$/,
    useHashIndex: true
});

Usage

Configure webpack.config.js to use the write-file-webpack-plugin plugin.

import path from 'path';
import WriteFilePlugin from 'write-file-webpack-plugin';

export default {
    output: {
        path: path.join(__dirname, './dist')
    },
    plugins: [
        new WriteFilePlugin()
    ],
    // ...
}

See ./sandbox for a working webpack configuration.

@openbaseio/package-build-stats@corratech/pwa-buildpackm2a-ui-libraryscreen-spec-md@react_pwa/buildpackfieldflint@startrco/slate-toolspwa-buildpack-revanth@lucas-boaideas/test-toolsares-next@spothero/ace@cloudkite/nextfelfire@sbase-theme-cli-demo/cli-service@sbase-theme-test/cli-service@electron.land/electron-scriptsreact-universal-framework@mapleinside/rendtest-react-scripts-condwebpack-kit@explodingcamera/next@everything-registry/sub-chunk-3166@pushengineering/slate-toolstdtoolsymphony-joytest-edt-cliteadanteawindfuryweave-iovussrvue-cli-plugin-write-fileweld-nextxm-roadhogteawhitescteagreenscreenteanandenandetearedscstanza-abtest-sentciltest-test-43h4h29423test-stream-nextswrnvue-cli-plugin-megalovue-cli-plugin-vuetobervue-cli-plugin-vuestorm@dotdevru/react-ssr-scripts@cross2d/next@cond-starterkit/react-scripts@copart/g2-ops-server@calltheguys/ctg-slate-tools@by-association-only/unisian-tools@by-association-only/slate-tools@perfsee/package-build-stats@roots/budpackivanpantekkeonkatatemakaonjskeststatic-nextuhuy-1uhuy-2uhuy-3umi-build-devui-spec-mdtf-tailortff-tailoruseless@antonioq/slate-tools@apployees-nx/webserver@asinc/wp-webpack@arco-design/arco-scripts@arielapaula/components@arielapaula/test@albkt/service@alex_roman/react-scripts@backlogics/cab-scripts@backlogics/crab-scripts@baaz/buildpack@baristalabs/react-scripts-ts@baristalabs/react-scripts-ts-ce@bazumax/quasar-app@bayuganteng11/contoh-ganteng@bcoe/next@agderposten/next@blorajs/umi-build-dev@bigsigmadevelopment/slate-tools@boa-ideas/slate-tools@brickblock/webpack-config@0x6368656174/wp-builder@ackee/react-scripts-browser-extension@acidic9/slate-tools@abds/components@codeverse/react-shuttle@boldr/tools@deskpro/apps-dpat@deskproapps/dpat@devo/applications-builder-cli@devo/applications-builder-client@devoinc/applications-builder-cli
4.5.1

6 years ago

4.5.0

7 years ago

4.4.1

7 years ago

4.4.0

7 years ago

4.3.2

7 years ago

4.3.1

7 years ago

4.3.0

7 years ago

4.2.0

8 years ago

4.1.0

8 years ago

4.0.2

8 years ago

4.0.0

8 years ago

3.4.2

9 years ago

3.4.1

9 years ago

3.4.0

9 years ago

3.3.0

9 years ago

3.1.8

9 years ago

3.1.7

9 years ago

3.1.6

9 years ago

3.1.5

9 years ago

3.1.4

9 years ago

3.1.3

9 years ago

3.1.2

9 years ago

3.1.1

10 years ago

3.1.0

10 years ago

3.0.0

10 years ago

2.1.2

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago