Skip to content

Commit b60c16b

Browse files
committed
omit JS code in bundle, add note about extraction
1 parent 3080148 commit b60c16b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/index.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path';
33
import webpack from 'webpack';
44
import sources from 'webpack-sources';
55

6-
const { RawSource, ConcatSource } = sources;
6+
const { ConcatSource } = sources;
77
const { Template } = webpack;
88

99
const NS = path.dirname(fs.realpathSync(__filename));
@@ -38,10 +38,7 @@ class CssModule extends webpack.Module {
3838
this.sourceMap = dependency.sourceMap;
3939
}
4040

41-
source() {
42-
// TODO add webpack support for omitting js source
43-
return new RawSource('// extracted by mini-css-extract-plugin');
44-
}
41+
// no source() so webpack doesn't do add stuff to the bundle
4542

4643
size() {
4744
return 0;

src/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function pitch(request) {
107107
} catch (e) {
108108
return callback(e);
109109
}
110-
let resultSource = '';
110+
let resultSource = '// extracted by mini-css-extract-plugin';
111111
if (text.locals && typeof resultSource !== 'undefined') {
112112
resultSource = `module.exports = ${JSON.stringify(text.locals)};`;
113113
}

0 commit comments

Comments
 (0)