Skip to content

Commit 21f98d6

Browse files
committed
Merge branch 'master' of http://github.com/webpack/webpack
2 parents 17ad013 + bbd6eb7 commit 21f98d6

59 files changed

Lines changed: 575 additions & 5044 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.eslintrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"root": true,
23
"env": {
34
"node": true
45
},

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
/coverage
88
.DS_Store
99
*.log
10-
.idea
10+
.idea
11+
yarn.lock
12+
.vscode

‎.travis.yml‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,26 @@ cache:
88

99
os:
1010
- linux
11-
# - osx
11+
- osx
1212
node_js:
13+
- "7"
1314
- "6"
1415
- "4"
16+
- "v0.12.17"
1517

1618
matrix:
1719
allow_failures:
1820
- node_js: "4"
21+
- node_js: "v0.12.17"
22+
- os: osx
1923

2024
script: npm run travis
2125
env:
2226
- NO_WATCH_TESTS=1
2327

28+
before_install: if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi
2429
install:
25-
- npm install yarn -g
26-
- yarn install
27-
- if [ ! -h "$HOME/.yarn-cache/.link/webpack" ]; then yarn link; fi
28-
- yarn link webpack
29-
30+
- bash ./ci/travis-install.sh
3031
after_success:
3132
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
3233
- cat ./coverage/coverage.json | node_modules/codecov.io/bin/codecov.io.js

‎appveyor.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ environment:
1212
install:
1313
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version)
1414
- npm install yarn -g
15-
- yarn install --msvs_version=2013
15+
- yarn install
1616
- yarn link
1717
- yarn link webpack
1818

‎bin/config-yargs.js‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module.exports = function(yargs) {
1010
yargs
1111
.help("help")
1212
.alias("help", "h", "?")
13+
.version()
14+
.alias("version", "v")
1315
.options({
1416
"config": {
1517
type: "string",
@@ -22,12 +24,6 @@ module.exports = function(yargs) {
2224
describe: "Enviroment passed to the config, when it is a function",
2325
group: CONFIG_GROUP
2426
},
25-
"version": {
26-
type: "string",
27-
describe: "Webpack version",
28-
alias: "v",
29-
group: BASIC_GROUP,
30-
},
3127
"context": {
3228
type: "string",
3329
describe: "The root directory for resolving entry point and stats",

‎bin/convert-argv.js‎

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,11 @@ fs.existsSync = fs.existsSync || path.existsSync;
44
var resolve = require("enhanced-resolve");
55
var interpret = require("interpret");
66
var WebpackOptionsDefaulter = require("../lib/WebpackOptionsDefaulter");
7-
var validateWebpackOptions = require("../lib/validateWebpackOptions");
87

9-
module.exports = function(optimist, argv, convertOptions) {
8+
module.exports = function(yargs, argv, convertOptions) {
109

1110
var options = [];
1211

13-
// Help
14-
if(argv.help) {
15-
optimist.showHelp();
16-
process.exit(0); // eslint-disable-line
17-
}
18-
19-
// Version
20-
if(argv.v || argv.version) {
21-
console.log(require("../package.json").version);
22-
process.exit(0); // eslint-disable-line
23-
}
24-
2512
// Shortcuts
2613
if(argv.d) {
2714
argv.debug = true;
@@ -53,7 +40,7 @@ module.exports = function(optimist, argv, convertOptions) {
5340

5441
var i;
5542
if(argv.config) {
56-
function getConfigExtension(configPath) {
43+
var getConfigExtension = function getConfigExtension(configPath) {
5744
for(i = extensions.length - 1; i >= 0; i--) {
5845
var tmpExt = extensions[i];
5946
if(configPath.indexOf(tmpExt, configPath.length - tmpExt.length) > -1) {
@@ -63,7 +50,7 @@ module.exports = function(optimist, argv, convertOptions) {
6350
return path.extname(configPath);
6451
}
6552

66-
function mapConfigArg(configArg) {
53+
var mapConfigArg = function mapConfigArg(configArg) {
6754
var resolvedPath = path.resolve(configArg);
6855
var extension = getConfigExtension(resolvedPath);
6956
return {
@@ -88,7 +75,7 @@ module.exports = function(optimist, argv, convertOptions) {
8875
}
8976

9077
if(configFiles.length > 0) {
91-
function registerCompiler(moduleDescriptor) {
78+
var registerCompiler = function registerCompiler(moduleDescriptor) {
9279
if(moduleDescriptor) {
9380
if(typeof moduleDescriptor === "string") {
9481
require(moduleDescriptor);
@@ -107,7 +94,7 @@ module.exports = function(optimist, argv, convertOptions) {
10794
}
10895
}
10996

110-
function requireConfig(configPath) {
97+
var requireConfig = function requireConfig(configPath) {
11198
var options = require(configPath);
11299
var isES6DefaultExportedFunc = (
113100
typeof options === "object" && options !== null && typeof options.default === "function"
@@ -538,7 +525,7 @@ module.exports = function(optimist, argv, convertOptions) {
538525
}
539526
ensureObject(options, "entry");
540527

541-
function addTo(name, entry) {
528+
var addTo = function addTo(name, entry) {
542529
if(options.entry[name]) {
543530
if(!Array.isArray(options.entry[name])) {
544531
options.entry[name] = [options.entry[name]];

‎ci/travis-install.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -ev
3+
4+
if [ "$TRAVIS_NODE_VERSION" == "v0.12.17" ]; then
5+
npm install --force && npm link && npm link webpack;
6+
else
7+
npm install yarn -g && yarn install && yarn link || true && yarn link webpack;
8+
fi

‎examples/README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,7 @@ If you think an example is missing, please report it as issue. :)
6767
# Building an Example
6868

6969
1. Run `npm install` in the root of the project.
70-
2. Run `node build.js` in the specific example directory. (Ex: `cd examples/commonjs && node build.js`)
70+
2. Run `npm link webpack` in the root of the project.
71+
3. Run `node build.js` in the specific example directory. (Ex: `cd examples/commonjs && node build.js`)
72+
73+
Note: To build all examples run `npm run build:examples`
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
require("bundle!./file.js")(function(fileJsExports) {
1+
require("bundle-loader!./file.js")(function(fileJsExports) {
22
console.log(fileJsExports);
3-
});
3+
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module.exports = {
22
module: {
33
loaders: [
4-
{ test: /\.coffee$/, loader: "coffee" }
4+
{ test: /\.coffee$/, loader: "coffee-loader" }
55
]
66
},
77
resolve: {
88
extensions: [".web.coffee", ".web.js", ".coffee", ".js"]
99
}
10-
}
10+
}

0 commit comments

Comments
 (0)