Skip to content

Commit 1526136

Browse files
committed
minor #262 Fixing bug where unnecessary files were being published to npm (weaverryan)
This PR was squashed before being merged into the master branch (closes #262). Discussion ---------- Fixing bug where unnecessary files were being published to npm Fixes #261 Webpack uses the `files` key, so we should too. It also means we don't need to try to maintain duplicate `.gitignore` and `.npmignore` files with the same contents. I've verified that the following files will be included in the package (+ all of `lib/` and `bin/`): <img width="422" alt="screen shot 2018-02-11 at 7 26 37 am" src="https://user-images.githubusercontent.com/121003/36073351-2b58ec26-0efd-11e8-91a3-ae627a7f33db.png"> Commits ------- dae5836 Fixing bug where unnecessary files were being published to npm
2 parents 53382bd + dae5836 commit 1526136

File tree

8 files changed

+13
-11
lines changed

8 files changed

+13
-11
lines changed

.eslintrc.js

-1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,3 @@ module.exports = {
5757
"header/header": [2, "block", {"pattern": "This file is part of the Symfony Webpack Encore package"}]
5858
}
5959
};
60-

.npmignore

-2
This file was deleted.

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,10 @@
8181
"vue-template-compiler": "^2.3.4",
8282
"webpack-notifier": "^1.5.0",
8383
"zombie": "^5.0.5"
84-
}
84+
},
85+
"files": [
86+
"lib/",
87+
"bin/",
88+
"index.js"
89+
]
8590
}

test/bin/encore.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const chai = require('chai');
1313
chai.use(require('chai-fs'));
1414
const expect = chai.expect;
1515
const path = require('path');
16-
const testSetup = require('../../lib/test/setup');
16+
const testSetup = require('../helpers/setup');
1717
const fs = require('fs-extra');
1818
const exec = require('child_process').exec;
1919

test/config/parse-runtime.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
const expect = require('chai').expect;
1313
const parseArgv = require('../../lib/config/parse-runtime');
14-
const testSetup = require('../../lib/test/setup');
14+
const testSetup = require('../helpers/setup');
1515
const fs = require('fs-extra');
1616
const path = require('path');
1717

test/functional.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const chai = require('chai');
1313
chai.use(require('chai-fs'));
1414
const expect = chai.expect;
1515
const path = require('path');
16-
const testSetup = require('../lib/test/setup');
16+
const testSetup = require('./helpers/setup');
1717
const fs = require('fs-extra');
1818

1919
function createWebpackConfig(outputDirName = '', command, argv = {}) {
File renamed without changes.

lib/test/setup.js renamed to test/helpers/setup.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
'use strict';
1111

1212
const path = require('path');
13-
const WebpackConfig = require('../WebpackConfig');
14-
const parseRuntime = require('../config/parse-runtime');
13+
const WebpackConfig = require('../../lib/WebpackConfig');
14+
const parseRuntime = require('../../lib/config/parse-runtime');
1515
const webpack = require('webpack');
1616
const fs = require('fs-extra');
1717
const Browser = require('zombie');
1818
const httpServer = require('http-server');
19-
const configGenerator = require('../config-generator');
20-
const validator = require('../config/validator');
19+
const configGenerator = require('../../lib/config-generator');
20+
const validator = require('../../lib/config/validator');
2121
const assertUtil = require('./assert');
2222

2323
const tmpDir = path.join(__dirname, '../', '../', 'test_tmp');

0 commit comments

Comments
 (0)