Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Commit 37bd6ee

Browse files
committed
Remove webpack require hacks - they don't work
1 parent 5a9fd24 commit 37bd6ee

File tree

4 files changed

+14
-32
lines changed

4 files changed

+14
-32
lines changed

lib/gcli/test/mockDocument.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var usingMockDocument = false;
2323
*/
2424
exports.setup = function(requisition) {
2525
if (requisition.environment.window == null) {
26-
var jsdom = require('j' + 'sdom').jsdom;
26+
var jsdom = require('jsdom').jsdom;
2727
var document = jsdom('' +
2828
'<html>' +
2929
'<head>' +

lib/gcli/test/suite.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ exports.init = function(isNode) {
3636
examiner.addSuite('testFail', require('./testFail'));
3737

3838
if (isNode) {
39-
examiner.addSuite('testFile', require('' + './testFile'));
40-
examiner.addSuite('testFileparser', require('' + './testFileparser'));
41-
examiner.addSuite('testFilesystem', require('' + './testFilesystem'));
39+
examiner.addSuite('testFile', require('./testFile'));
40+
examiner.addSuite('testFileparser', require('./testFileparser'));
41+
examiner.addSuite('testFilesystem', require('./testFilesystem'));
4242
}
4343

4444
examiner.addSuite('testFocus', require('./testFocus'));

lib/gcli/util/host.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ exports.spawn = function(context, spawnSpec) {
8787
if (isNode) {
8888
return new Promise(function(resolve, reject) {
8989
var output = { data: '' };
90-
var childProcess = require('c' + 'hild_process');
90+
var childProcess = require('child_process');
9191
var child = childProcess.spawn(spawnSpec.cmd, spawnSpec.args, {
9292
env: spawnSpec.env,
9393
cwd: spawnSpec.cwd
@@ -171,7 +171,7 @@ exports.exec = function(task) {
171171
*/
172172
exports.createUrl = function(uristr, base) {
173173
if (isNode) {
174-
var U = require('d' + 'om-urls');
174+
var U = require('dom-urls');
175175
return new U(uristr, base);
176176
}
177177
else {
@@ -186,7 +186,7 @@ exports.createUrl = function(uristr, base) {
186186
*/
187187
exports.toDom = function(document, html) {
188188
if (document == null) {
189-
var jsdom = require('j' + 'sdom').jsdom;
189+
var jsdom = require('jsdom').jsdom;
190190
document = jsdom('<html><head></head><body></body></html>');
191191
}
192192

@@ -206,11 +206,11 @@ exports.toDom = function(document, html) {
206206
exports.staticRequire = function(requistingModule, name) {
207207
return new Promise(function(resolve, reject) {
208208
if (isNode) {
209-
var path = require('p' + 'ath');
209+
var path = require('path');
210210
var parent = path.dirname(requistingModule.id);
211211
var filename = parent + '/' + name;
212212

213-
var fs = require('f' + 's');
213+
var fs = require('fs');
214214
fs.readFile(filename, { encoding: 'utf8' }, function(err, data) {
215215
if (err) {
216216
reject(err);

webpack.config.js

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,14 @@ module.exports = {
3434
loaders: [
3535
{ test: /\.css$/, loader: 'raw' },
3636
{ test: /\.html$/, loader: 'raw' },
37-
{ test: /\.json/, loader: 'json' },
37+
{ test: /\.json$/, loader: 'json' },
3838
],
3939
},
4040
plugins: [
41-
new webpack.IgnorePlugin(/jsdom$/),
42-
new webpack.IgnorePlugin(/fs$/),
43-
new webpack.IgnorePlugin(/express$/),
4441
new webpack.IgnorePlugin(/child_process$/),
45-
new webpack.IgnorePlugin(/body-parser$/),
46-
new webpack.IgnorePlugin(/^text!gcli/),
42+
new webpack.IgnorePlugin(/dom-urls$/),
43+
new webpack.IgnorePlugin(/fs$/),
44+
new webpack.IgnorePlugin(/jsdom$/),
45+
new webpack.IgnorePlugin(/path$/),
4746
],
4847
};
49-
50-
var compiler = webpack(module.exports);
51-
52-
compiler.run(function(err, stats) {
53-
if (err) {
54-
throw new Error(err);
55-
}
56-
57-
console.log(stats.toString({ colors: true }));
58-
59-
//stats.compilation.errors
60-
// .map(function(s) { return s.message; })
61-
// .forEach(console.log);
62-
//stats.compilation.warnings
63-
// .map(function(s) { return s.message; })
64-
// .forEach(console.log);
65-
});

0 commit comments

Comments
 (0)