Skip to content

Commit

Permalink
updates plugin to work with 3.0.1 version on extract-text-webpack-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
vpanov committed Oct 4, 2017
1 parent 434c348 commit a5608c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');

const ExtractTextPlugin = require('extract-text-webpack-plugin');
const Chunk = require("webpack/lib/Chunk");
const ExtractedModule = require("extract-text-webpack-plugin/ExtractedModule");
const ExtractedModule = require("extract-text-webpack-plugin/dist/lib/ExtractedModule");
const SortableSet = require("webpack/lib/util/SortableSet");

class ExtractTextPluginCSS extends ExtractTextPlugin {
Expand Down Expand Up @@ -193,7 +193,7 @@ class ExtractTextPluginCSS extends ExtractTextPlugin {
debugger;

// TODO: additionalInformation
var newModule = new ExtractedModule(commonChunkId, mod, mod.source().source());
var newModule = new ExtractedModule.default(commonChunkId, mod, mod.source().source());

// add extracted module to corresponding common chunk
commonChunks[commonChunkId].addModule(newModule);
Expand All @@ -205,7 +205,7 @@ class ExtractTextPluginCSS extends ExtractTextPlugin {
// which is missing in Sets
var modulesArray = Array.from(chunk.modules);
requiredCommonChunks.reverse().forEach(commonChunkId => {
var module = new ExtractedModule(`css-import-module-${commonChunkId}`, null, `@import "${this._getChunkPath(compilation, commonChunks[commonChunkId], true)}";\n`);
var module = new ExtractedModule.default(`css-import-module-${commonChunkId}`, null, `@import "${this._getChunkPath(compilation, commonChunks[commonChunkId], true)}";\n`);

modulesArray.unshift(module);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "msnt-extract-css-webpack-plugin",
"version": "0.0.2",
"version": "0.0.3",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit a5608c6

Please sign in to comment.