Skip to content
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.

A plugin breaks builds in webpack core in webpack 1.13.1 #24

Open
dmitriid opened this issue Jun 16, 2016 · 0 comments
Open

A plugin breaks builds in webpack core in webpack 1.13.1 #24

dmitriid opened this issue Jun 16, 2016 · 0 comments

Comments

@dmitriid
Copy link

Cross-posted from mrsum/webpack-svgstore-plugin#95 as I don't know whose problem it is.

tl;dr Having plugin enabled breaks webpack builds somwhere in webpack-core/lib/ConcatSource.js

> npm install --save-dev webpack

This installs webpack 1.13.1

Given the following webpack.config:

var SvgStore = require('webpack-svgstore-plugin');

var config = {
    entry:   {
        app: [
            '/soma-file.js'
        ],
        lib: [
            'lodash'
        ]
    },
    output:  {
        path:              '/path',
        filename:          filename
    },
    module:  {
        loaders: [
            {
                test:   /\.js$/,
                loader: 'babel',
                query:  {
                    presets: ['es2015', 'stage-0', 'react'],
                    compact: false
                }
            },
            {
                test:   /\.json$/,
                loader: 'json'
            }
        ]
    },
    plugins: [
        new SvgStore(path.join('./img/svg', '', '**!/!*.svg'), path.join('./', ''), {
            name:        '[hash].sprite.svg',
            chunk:       'app',
            prefix:      'pref-',
            baseUrl:     '/my-url',
            svgoOptions: {}
        }),
        new webpack.optimize.CommonsChunkPlugin("lib", "lib.js", Infinity)
    ],
    bail:    false,
    target:  'web'
};

Trying to run this results in:

/node_modules/webpack-core/lib/ConcatSource.js:24
        return typeof item === "string" ? item : item.source();
                                                     ^

TypeError: Cannot read property 'source' of undefined
    at /node_modules/webpack-core/lib/ConcatSource.js:24:48
    at Array.map (native)
    at ConcatSource.source (/node_modules/webpack-core/lib/ConcatSource.js:23:23)
    at Compiler.writeOut (/node_modules/webpack/lib/Compiler.js:256:26)
    at Compiler.<anonymous> (/node_modules/webpack/lib/Compiler.js:246:20)
    at /node_modules/async/lib/async.js:181:20
    at Object.async.forEachOf.async.eachOf (/node_modules/async/lib/async.js:233:13)
    at Object.async.forEach.async.each (/node_modules/async/lib/async.js:209:22)
    at Compiler.emitFiles (/node_modules/webpack/lib/Compiler.js:235:20)
    at /node_modules/mkdirp/index.js:48:26
    at FSReqWrap.oncomplete (fs.js:82:15)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant