Giter Club home page Giter Club logo

create-file-webpack's Introduction

Create file plugin for WebPack

License: MIT

Very simple plugin to create a file at the end of the build process with the particular text.

Installation

npm i create-file-webpack --save-dev

Usage

const CreateFileWebpack = require('create-file-webpack')

// webpack config
{
  plugins: [
    new CreateFileWebpack({options})
  ]
}

List of possible options:

var opts = {
    // path to folder in which the file will be created
    path: './dist',
    // file name
    fileName: 'index.js',
    // content of the file
    content: 'export * from ./module.umd.js'
};

create-file-webpack's People

Contributors

appius avatar vladyslav-ushakov-epamcom avatar willmacdonald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

create-file-webpack's Issues

Upgrade to webpack `.hooks` API

this plugin uses Tapable.plugin which webpack has deprecated. Stacktrace below

(node:17285) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
    at CreateFilePlugin.apply (/Users/kit/toast/git-repos/new-project/node_modules/create-file-webpack/index.js:14:18)
    at webpack (/Users/kit/toast/git-repos/new-project/node_modules/webpack/lib/webpack.js:37:12)
    at module.exports (/Users/kit/toast/git-repos/new-project/server/webpack-dev-middleware.js:94:27)
    at getPort.then.actualPort (/Users/kit/toast/git-repos/new-project/server/index.js:98:40)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

For more information, see this comment in webpack: webpack/webpack#6568 (comment)

Update npm README

Hi! Thanks for this plugin, it solved a tough problem for me! I noticed that your npm README has main as the key for the generated file name, and this repo shows it's fileName. That threw me for a bit. Just hoping to make some else's life easier. Cheers!

Add hash to insert

I've got a branch to add compilation hash to the inserted file, do you want a pull request for it?

[Feature Request] - Add the file at the beginning of the build process, not the end

I'm using this plugin to take a set of colours defined in JS and generate a Sass file with them.

It would be great if that file was created at the beginning of the build process so it can be imported by other Sass files.

I imagine this being a config option.

I'm happy to submit a PR if you could point me in the right direction,
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.