Giter Club home page Giter Club logo

webpack-blocks-server-source-map's Introduction

webpack-blocks-server-source-map

Generated with nod NPM version Build Status Coverage Status

A webpack block that adds source map support to server bundle.

Install

$ npm install --save-dev webpack-blocks-server-source-map

Usage

const { createConfig } = require('@webpack-blocks/webpack2')
const serverSourceMap = require('webpack-blocks-server-source-map')

module.exports = createConfig([
  serverSourceMap()
])

How it does

  • changes devtool to sourcemap;
  • inserts require("source-map-support").install(); at the top of generated server files to require source-map-support and enable source map.

For more details, see src/index.js.

API

serverSourceMap

Adds source map support to server bundle.

Parameters

  • devtool string? (optional, default 'source-map')

Returns Function webpack block

Other useful webpack blocks

License

MIT © Diego Haz

webpack-blocks-server-source-map's People

Contributors

diegohaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

webpack-blocks-server-source-map's Issues

Migrate to webpack-blocks v1

Webpack-block v1 is a release candidate and the API for blocks has changed a bit, see https://github.com/andywer/webpack-blocks/blob/master/docs/BLOCK-CREATION.md

I believe your block should now be:

function serverSourceMap(devtool = 'source-map') {
  return (context, { addPlugin }) => {
    return (prevConfig) => {
      return Object.assign(
        addPlugin(new webpack.BannerPlugin({
          banner: 'require("source-map-support").install();',
          raw: true,
          entryOnly: false,
        }))(prevConfig),
        { devtool }
      );
    };
  };
}

I was too lazy to write a PR, but let me know if you'd be interested.

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.