Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use babel to compile babel-loader #319

Merged
merged 1 commit into from
Oct 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
["latest", { "es2015": { "loose": true } }]
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
lib
node_modules
test/output
coverage
Expand Down
1 change: 1 addition & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"preset": "node-style-guide",
"fileExtensions": [ ".js", "jscs" ],
"excludeFiles": [
"lib/**",
"test/fixtures/**",
"test/output/**",
"node_modules/**"
Expand Down
1 change: 1 addition & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
lib
test/fixtures
test/output
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"strict": true,
"strict": false,
"node": true,
"mocha": true
}
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
sudo: false
language: node_js
os:
- linux
- osx
node_js:
- node
- "6"
- "5"
- "4"
- "0.12"
- "0.10"
env:
- export WEBPACK_VERSION="2.1.0-beta.22"
- export WEBPACK_VERSION="1"
matrix:
fast_finish: true
allow_failures:
- os: osx
before_install:
- nvm --version
- node --version
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "6.2.7",
"description": "babel module loader for webpack",
"files": [
"index.js",
"lib"
],
"main": "lib/index.js",
"dependencies": {
"find-cache-dir": "^0.1.1",
"loader-utils": "^0.2.11",
Expand All @@ -17,7 +17,9 @@
"webpack": "1 || ^2.1.0-beta"
},
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.0.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-es2015": "^6.0.0",
"expect.js": "^0.3.1",
"istanbul": "^0.4.0",
Expand All @@ -27,12 +29,14 @@
"rimraf": "^2.4.3"
},
"scripts": {
"test": "npm run hint && npm run cs && npm run cover",
"travis": "npm run cover -- --report lcovonly",
"build": "babel src/ --out-dir lib/",
"test": "npm run build && npm run hint && npm run cs && npm run cover",
"travis": "npm run build && npm run cover -- --report lcovonly",
"cover": "istanbul cover ./node_modules/.bin/_mocha -- test/*.test.js",
"postcover": "npm run hint && npm run cs",
"hint": "jshint --config .jshintrc index.js lib/* test/*",
"cs": "jscs --config .jscsrc index.js lib/* test/*"
"prepublish": "npm run build",
"hint": "jshint --config .jshintrc src/* test/*",
"cs": "jscs --config .jscsrc src/* test/*"
},
"repository": {
"type": "git",
Expand Down
2 changes: 0 additions & 2 deletions lib/fs-cache.js → src/fs-cache.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Filesystem cache
*
Expand Down
2 changes: 0 additions & 2 deletions lib/helpers/exists.js → src/helpers/exists.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

var fs = require('fs');
/**
* Check if file exists and cache the result
Expand Down
2 changes: 0 additions & 2 deletions lib/helpers/read.js → src/helpers/read.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

var fs = require('fs');
/**
* Read the file and cache the result
Expand Down
12 changes: 5 additions & 7 deletions index.js → src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
'use strict';

var assign = require('object-assign');
var babel = require('babel-core');
var loaderUtils = require('loader-utils');
var cache = require('./lib/fs-cache.js');
var exists = require('./lib/helpers/exists')();
var read = require('./lib/helpers/read')();
var resolveRc = require('./lib/resolve-rc.js');
var pkg = require('./package.json');
var path = require('path');
var cache = require('./fs-cache.js');
var exists = require('./helpers/exists')();
var read = require('./helpers/read')();
var resolveRc = require('./resolve-rc.js');
var pkg = require('./../package.json');

/**
* Error thrown by Babel formatted to conform to Webpack reporting.
Expand Down
2 changes: 0 additions & 2 deletions lib/resolve-rc.js → src/resolve-rc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* The purpose of this module, is to find the project's .babelrc and
* use its contents to bust the babel-loader's internal cache whenever an option
Expand Down