Initial commit

This commit is contained in:
Developer
2025-04-21 16:03:20 +02:00
commit 2832896157
22874 changed files with 3092801 additions and 0 deletions

View File

@@ -0,0 +1,169 @@
# Changelog
For changes in version v7.0.0 and up please go to [release](https://github.com/babel/babel-loader/releases)
# Old Changelog
## v6.4.1
### 🐛 Bug Fix
- Fixed reset of BABEL_ENV when options.forceEnv is used (#420) @nikopavlica
## v6.4.0
### 🚀 New Feature
- added metadata passing from babel to webpack, which is currently used by react-intl (#398) @Ognian
## v6.3.2
### 😢 Regression
- `forceEnv` was interfering with regular environment handling
## v6.3.1
### 🐛 Bug Fix
- The new `forceEnv` options wasn't working as expected (#379) @chrisvasz
## v6.3.0
### 🚀 New Feature
- Add new config option `forceEnv` (#368) @moimael
Allow to override BABEL_ENV/NODE_ENV at loader-level. Useful for isomorphic applications which have separate babel config for client and server.
### 🐛 Bug Fix
- Update loader-utils dependency to ^0.2.16 to fix compatibility with webpack 2 (#371) @leonaves
### 💅 Polish
- Improve FS caching to do less sync calls which improves performance slightly (#375) @akx
## v6.2.10
Support for webpack 2.2-rc has been added in this release
### 🐛 Bug Fix
- If cache directory not writable, try to fallback to tmpdir before failing
## v6.2.9
### 😢 Regression
Source maps on windows did not work correctly with v6.2.8.
Thanks @josephst
### 🏠 Internal
- Add AppVeyor to run tests on windows @danez
- Fix tests on windows (#343) @danez
## v6.2.8
### 🐛 Bug Fix
- gzipped files should have `.gz` as the extension, not `.gzip` (#326) @bjornstar
- fix options.sourceFileName gennerate bug (#260) @creeperyang
### 📝 Documentation
- Update README docs for cacheDirectory's actual behaviour (#245) @sohkai
- updates docs re: transform-runtime (#197) @gbrassey
### 🏠 Internal
- Use eslint and nyc (#321) @danez
- Adjust travis config (#320) @danez
- Use babel to compile babel-loader (#319) @danez
## v6.2.7
### 😢 Regression
Fallback to `os.tmpdir()` if no cachedir found (#318) (fixes #317) @danez
Fixes an issue with v6.2.6 when using `babel-loader` as a global package.
## v6.2.6
### 🐛 Bug Fix
- Use standard cache dir as default `cacheDirectory` (#301) @fson
Use the common cache directory, `./node_modules/.cache/babel-loader`, as the default cache directory (when the cacheDirectory setting is enabled).
```js
query: {
cacheDirectory: true
}
```
## v6.2.5
- Don't show the call stack for a Babel error (such as when you have a syntax error)
<img width="415" alt="screenshot 2016-08-15 15 24 37" src="https://cloud.githubusercontent.com/assets/30594/17664401/727ba098-62fc-11e6-9f12-42da0cf47f14.png">
- resolve the .babelrc relative to the file path rather than the cwd (current working directory).
* fix: more concise formatting for Babel errors (#287) (Andrey Popp)
* fix(resolve-rc): resolve-rc relative file path (#253) (Luke Page)
* add babel-core and preset-2015 to dev dependencies (#273) (timse)
* chore(docs): add issue and pr templates (#280) (Joshua Wiens)
* chore(docs): fix badge formatting (Joshua Wiens)
* chore(ci): expand travis testing (#278) (Joshua Wiens)
* Update README: add env vars to cacheIdentifier (#267) (Dominik Ferber)
* add npm badge [skip ci] (Henry Zhu)
* update [skip ci] (Henry Zhu)
* remove jsx references as well [skip ci] (Henry Zhu)
* Save the transform to devDependencies (Ray Booysen)
* Remove 'react' preset (Jake Rios)
* Removed babel-preset-react from README.md (Ben Stephenson)
## v6.2.4
* change allowed peer deps (all webpack 2 beta versions)
## v6.2.3
* change allowed peer deps (2.0.7-beta)
## v6.2.2
* Update peerDependencies to accept webpack 2 [#208](https://github.com/babel/babel-loader/pull/208)
* Remove duplicated dependencies
## v6.2.0
* Pass true filenames [#106](https://github.com/babel/babel-loader/issues/106)
* Remove babel-core from devDependencies
## v6.1.0
* Merge [PR #146](https://github.com/babel/babel-loader/pull/146) Set source file name relative to options.sourceRoot
* Merge [PR #136](https://github.com/babel/babel-loader/pull/136) use container-based infrastructure for faster build
* Merge [PR #121](https://github.com/babel/babel-loader/pull/121) Make babelrc configurable
* Merge [PR #113](https://github.com/babel/babel-loader/pull/113) Include BABEL_ENV || NODE_ENV in cacheIdentifier
## v6.0.1
* Update to babel v6.
## v5.3.1
* Merge [PR #85](https://github.com/babel/babel-loader/pull/85) - Don't override sourcemap if sourcesContent already exists.
## v5.3.1
* Merge [PR #82](https://github.com/babel/babel-loader/pull/82) - Fallback global options to empty object to avoid conflicts with object-assign polyfill.
## v5.3.0
* Merge [PR #79](https://github.com/babel/babel-loader/pull/79) - This should allow babel-loader to work with [enhanced-require](https://github.com/webpack/enhanced-require).
## v5.2.0
* Include `.babelrc` file into the `cacheIdentifier` if it exists

View File

@@ -0,0 +1,22 @@
Copyright (c) 2014-2016 Luís Couto <hello@luiscouto.pt>
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,208 @@
[![NPM Status](https://img.shields.io/npm/v/babel-loader.svg?style=flat)](https://www.npmjs.com/package/babel-loader)
[![Build Status](https://travis-ci.org/babel/babel-loader.svg?branch=master)](https://travis-ci.org/babel/babel-loader)
[![Build Status](https://ci.appveyor.com/api/projects/status/vgtpr2i5bykgyuqo/branch/master?svg=true)](https://ci.appveyor.com/project/danez/babel-loader/branch/master)
[![codecov](https://codecov.io/gh/babel/babel-loader/branch/master/graph/badge.svg)](https://codecov.io/gh/babel/babel-loader)
<div align="center">
<a href="https://github.com/babel/babel/">
<img width="200" height="200" src="https://rawgit.com/babel/logo/master/babel.svg">
</a>
<a href="https://github.com/webpack/webpack">
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
</a>
<h1>Babel Loader</h1>
</div>
This package allows transpiling JavaScript files using [Babel](https://github.com/babel/babel) and [webpack](https://github.com/webpack/webpack).
__Notes:__ Issues with the output should be reported on the babel [issue tracker](https://github.com/babel/babel/issues).
<h2 align="center">Install</h2>
> webpack 1.x | babel-loader <= 6.x
>
> webpack 2.x | babel-loader >= 7.x (recommended) (^6.2.10 will also work, but with deprecation warnings)
>
> webpack 3.x | babel-loader >= 7.1
```bash
yarn add babel-loader babel-core babel-preset-env webpack --dev
```
We recommend using yarn, but you can also still use npm:
```bash
npm install --save-dev babel-loader babel-core babel-preset-env webpack
```
<h2 align="center">Usage</h2>
[Documentation: Using loaders](https://webpack.js.org/loaders/)
Within your webpack configuration object, you'll need to add the babel-loader to the list of modules, like so:
```javascript
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
}
]
}
```
### Options
See the `babel` [options](https://babeljs.io/docs/usage/api/#options).
You can pass options to the loader by using the [options property](https://webpack.js.org/configuration/module/#rule-options-rule-query):
```javascript
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env'],
plugins: [require('babel-plugin-transform-object-rest-spread')]
}
}
}
]
}
```
This loader also supports the following loader-specific option:
* `cacheDirectory`: Default `false`. When set, the given directory will be used to cache the results of the loader. Future webpack builds will attempt to read from the cache to avoid needing to run the potentially expensive Babel recompilation process on each run. If the value is blank (`loader: 'babel-loader?cacheDirectory'`) or `true` (`loader: babel-loader?cacheDirectory=true`) the loader will use the default cache directory in `node_modules/.cache/babel-loader` or fallback to the default OS temporary file directory if no `node_modules` folder could be found in any root directory.
* `cacheIdentifier`: Default is a string composed by the babel-core's version, the babel-loader's version, the contents of .babelrc file if it exists and the value of the environment variable `BABEL_ENV` with a fallback to the `NODE_ENV` environment variable. This can be set to a custom value to force cache busting if the identifier changes.
* `forceEnv`: Default will resolve BABEL_ENV then NODE_ENV. Allow you to override BABEL_ENV/NODE_ENV at the loader level. Useful for isomorphic applications with different babel configuration for client and server.
__Note:__ The `sourceMap` option is ignored, instead sourceMaps are automatically enabled when webpack is configured to use them (via the `devtool` config option).
## Troubleshooting
### babel-loader is slow!
Make sure you are transforming as few files as possible. Because you are probably
matching `/\.js$/`, you might be transforming the `node_modules` folder or other unwanted
source.
To exclude `node_modules`, see the `exclude` option in the `loaders` config as documented above.
You can also speed up babel-loader by as much as 2x by using the `cacheDirectory` option.
This will cache transformations to the filesystem.
### babel is injecting helpers into each file and bloating my code!
babel uses very small helpers for common functions such as `_extend`. By default
this will be added to every file that requires it.
You can instead require the babel runtime as a separate module to avoid the duplication.
The following configuration disables automatic per-file runtime injection in babel, instead
requiring `babel-plugin-transform-runtime` and making all helper references use it.
See the [docs](http://babeljs.io/docs/plugins/transform-runtime/) for more information.
**NOTE:** You must run `npm install babel-plugin-transform-runtime --save-dev` to include this in your project and `babel-runtime` itself as a dependency with `npm install babel-runtime --save`.
```javascript
rules: [
// the 'transform-runtime' plugin tells babel to require the runtime
// instead of inlining it.
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env'],
plugins: ['transform-runtime']
}
}
}
]
```
#### **NOTE:** transform-runtime & custom polyfills (e.g. Promise library)
Since [babel-plugin-transform-runtime](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime) includes a polyfill that includes a custom [regenerator runtime](https://github.com/facebook/regenerator/blob/master/packages/regenerator-runtime/runtime.js) and [core.js](https://github.com/zloirock/core-js), the following usual shimming method using `webpack.ProvidePlugin` will not work:
```javascript
// ...
new webpack.ProvidePlugin({
'Promise': 'bluebird'
}),
// ...
```
The following approach will not work either:
```javascript
require('babel-runtime/core-js/promise').default = require('bluebird');
var promise = new Promise;
```
which outputs to (using `runtime`):
```javascript
'use strict';
var _Promise = require('babel-runtime/core-js/promise')['default'];
require('babel-runtime/core-js/promise')['default'] = require('bluebird');
var promise = new _Promise();
```
The previous `Promise` library is referenced and used before it is overridden.
One approach is to have a "bootstrap" step in your application that would first override the default globals before your application:
```javascript
// bootstrap.js
require('babel-runtime/core-js/promise').default = require('bluebird');
// ...
require('./app');
```
### The node API for `babel` has been moved to `babel-core`.
If you receive this message it means that you have the npm package `babel` installed and use the short notation of the loader in the webpack config (which is not valid anymore as of webpack 2.x):
```js
{
test: /\.js$/,
loader: 'babel',
}
```
Webpack then tries to load the `babel` package instead of the `babel-loader`.
To fix this you should uninstall the npm package `babel` as it is deprecated in babel v6. (instead install `babel-cli` or `babel-core`)
In the case one of your dependencies is installing `babel` and you cannot uninstall it yourself, use the complete name of the loader in the webpack config:
```js
{
test: /\.js$/,
loader: 'babel-loader',
}
```
## [License](http://couto.mit-license.org/)

View File

@@ -0,0 +1,180 @@
"use strict";
/**
* Filesystem cache
*
* Given a file and a transform function, cache the result into files
* or retrieve the previously cached files if the given file is already known.
*
* @see https://github.com/babel/babel-loader/issues/34
* @see https://github.com/babel/babel-loader/pull/41
*/
var crypto = require("crypto");
var mkdirp = require("mkdirp");
var findCacheDir = require("find-cache-dir");
var fs = require("fs");
var os = require("os");
var path = require("path");
var zlib = require("zlib");
var defaultCacheDirectory = null; // Lazily instantiated when needed
/**
* Read the contents from the compressed file.
*
* @async
* @params {String} filename
* @params {Function} callback
*/
var read = function read(filename, callback) {
return fs.readFile(filename, function (err, data) {
if (err) return callback(err);
return zlib.gunzip(data, function (err, content) {
if (err) return callback(err);
var result = {};
try {
result = JSON.parse(content);
} catch (e) {
return callback(e);
}
return callback(null, result);
});
});
};
/**
* Write contents into a compressed file.
*
* @async
* @params {String} filename
* @params {String} result
* @params {Function} callback
*/
var write = function write(filename, result, callback) {
var content = JSON.stringify(result);
return zlib.gzip(content, function (err, data) {
if (err) return callback(err);
return fs.writeFile(filename, data, callback);
});
};
/**
* Build the filename for the cached file
*
* @params {String} source File source code
* @params {Object} options Options used
*
* @return {String}
*/
var filename = function filename(source, identifier, options) {
var hash = crypto.createHash("md4");
var contents = JSON.stringify({
source: source,
options: options,
identifier: identifier
});
hash.update(contents);
return hash.digest("hex") + ".json.gz";
};
/**
* Handle the cache
*
* @params {String} directory
* @params {Object} params
* @params {Function} callback
*/
var handleCache = function handleCache(directory, params, callback) {
var source = params.source;
var options = params.options || {};
var transform = params.transform;
var identifier = params.identifier;
var shouldFallback = typeof params.directory !== "string" && directory !== os.tmpdir();
// Make sure the directory exists.
mkdirp(directory, function (err) {
// Fallback to tmpdir if node_modules folder not writable
if (err) return shouldFallback ? handleCache(os.tmpdir(), params, callback) : callback(err);
var file = path.join(directory, filename(source, identifier, options));
return read(file, function (err, content) {
var result = {};
// No errors mean that the file was previously cached
// we just need to return it
if (!err) return callback(null, content);
// Otherwise just transform the file
// return it to the user asap and write it in cache
try {
result = transform(source, options);
} catch (error) {
return callback(error);
}
return write(file, result, function (err) {
// Fallback to tmpdir if node_modules folder not writable
if (err) return shouldFallback ? handleCache(os.tmpdir(), params, callback) : callback(err);
callback(null, result);
});
});
});
};
/**
* Retrieve file from cache, or create a new one for future reads
*
* @async
* @param {Object} params
* @param {String} params.directory Directory to store cached files
* @param {String} params.identifier Unique identifier to bust cache
* @param {String} params.source Original contents of the file to be cached
* @param {Object} params.options Options to be given to the transform fn
* @param {Function} params.transform Function that will transform the
* original file and whose result will be
* cached
*
* @param {Function<err, result>} callback
*
* @example
*
* cache({
* directory: '.tmp/cache',
* identifier: 'babel-loader-cachefile',
* source: *source code from file*,
* options: {
* experimental: true,
* runtime: true
* },
* transform: function(source, options) {
* var content = *do what you need with the source*
* return content;
* }
* }, function(err, result) {
*
* });
*/
module.exports = function (params, callback) {
var directory = void 0;
if (typeof params.directory === "string") {
directory = params.directory;
} else {
if (defaultCacheDirectory === null) {
defaultCacheDirectory = findCacheDir({ name: "babel-loader" }) || os.tmpdir();
}
directory = defaultCacheDirectory;
}
handleCache(directory, params, callback);
};

View File

@@ -0,0 +1,183 @@
"use strict";
var babel = require("babel-core");
var loaderUtils = require("loader-utils");
var path = require("path");
var cache = require("./fs-cache.js");
var exists = require("./utils/exists");
var relative = require("./utils/relative");
var read = require("./utils/read");
var resolveRc = require("./resolve-rc.js");
var pkg = require("../package.json");
var fs = require("fs");
/**
* Error thrown by Babel formatted to conform to Webpack reporting.
*/
function BabelLoaderError(name, message, codeFrame, hideStack, error) {
Error.call(this);
this.name = "BabelLoaderError";
this.message = formatMessage(name, message, codeFrame);
this.hideStack = hideStack;
this.error = error;
Error.captureStackTrace(this, BabelLoaderError);
}
BabelLoaderError.prototype = Object.create(Error.prototype);
BabelLoaderError.prototype.constructor = BabelLoaderError;
var STRIP_FILENAME_RE = /^[^:]+: /;
var formatMessage = function formatMessage(name, message, codeFrame) {
return (name ? name + ": " : "") + message + "\n\n" + codeFrame + "\n";
};
var transpile = function transpile(source, options) {
var forceEnv = options.forceEnv;
var tmpEnv = void 0;
delete options.forceEnv;
if (forceEnv) {
tmpEnv = process.env.BABEL_ENV;
process.env.BABEL_ENV = forceEnv;
}
var result = void 0;
try {
result = babel.transform(source, options);
} catch (error) {
if (forceEnv) restoreBabelEnv(tmpEnv);
if (error.message && error.codeFrame) {
var message = error.message;
var name = void 0;
var hideStack = void 0;
if (error instanceof SyntaxError) {
message = message.replace(STRIP_FILENAME_RE, "");
name = "SyntaxError";
hideStack = true;
} else if (error instanceof TypeError) {
message = message.replace(STRIP_FILENAME_RE, "");
hideStack = true;
}
throw new BabelLoaderError(name, message, error.codeFrame, hideStack, error);
} else {
throw error;
}
}
var code = result.code;
var map = result.map;
var metadata = result.metadata;
if (map && (!map.sourcesContent || !map.sourcesContent.length)) {
map.sourcesContent = [source];
}
if (forceEnv) restoreBabelEnv(tmpEnv);
return {
code: code,
map: map,
metadata: metadata
};
};
function restoreBabelEnv(prevValue) {
if (prevValue === undefined) {
delete process.env.BABEL_ENV;
} else {
process.env.BABEL_ENV = prevValue;
}
}
function passMetadata(s, context, metadata) {
if (context[s]) {
context[s](metadata);
}
}
module.exports = function (source, inputSourceMap) {
var _this = this;
var filename = this.resourcePath;
// Handle options
var loaderOptions = loaderUtils.getOptions(this) || {};
var fileSystem = this.fs ? this.fs : fs;
var babelrcPath = null;
if (loaderOptions.babelrc !== false) {
babelrcPath = typeof loaderOptions.babelrc === "string" && exists(fileSystem, loaderOptions.babelrc) ? loaderOptions.babelrc : resolveRc(fileSystem, path.dirname(filename));
}
if (babelrcPath) {
this.addDependency(babelrcPath);
}
var defaultOptions = {
metadataSubscribers: [],
inputSourceMap: inputSourceMap,
sourceRoot: process.cwd(),
filename: filename,
cacheIdentifier: JSON.stringify({
"babel-loader": pkg.version,
"babel-core": babel.version,
babelrc: babelrcPath ? read(fileSystem, babelrcPath) : null,
env: loaderOptions.forceEnv || process.env.BABEL_ENV || process.env.NODE_ENV || "development"
})
};
var options = Object.assign({}, defaultOptions, loaderOptions);
if (loaderOptions.sourceMap === undefined) {
options.sourceMap = this.sourceMap;
}
if (options.sourceFileName === undefined) {
options.sourceFileName = relative(options.sourceRoot, options.filename);
}
var cacheDirectory = options.cacheDirectory;
var cacheIdentifier = options.cacheIdentifier;
var metadataSubscribers = options.metadataSubscribers;
delete options.cacheDirectory;
delete options.cacheIdentifier;
delete options.metadataSubscribers;
if (cacheDirectory) {
var callback = this.async();
return cache({
directory: cacheDirectory,
identifier: cacheIdentifier,
source: source,
options: options,
transform: transpile
}, function (err) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
code = _ref.code,
map = _ref.map,
metadata = _ref.metadata;
if (err) return callback(err);
metadataSubscribers.forEach(function (s) {
return passMetadata(s, _this, metadata);
});
return callback(null, code, map);
});
}
var _transpile = transpile(source, options),
code = _transpile.code,
map = _transpile.map,
metadata = _transpile.metadata;
metadataSubscribers.forEach(function (s) {
return passMetadata(s, _this, metadata);
});
this.callback(null, code, map);
};

View File

@@ -0,0 +1,26 @@
"use strict";
var path = require("path");
var exists = require("./utils/exists");
module.exports = function find(fileSystem, start) {
var _arr = [".babelrc", "package.json"];
for (var _i = 0; _i < _arr.length; _i++) {
var fileName = _arr[_i];
var file = path.join(start, fileName);
if (exists(fileSystem, file)) {
if (fileName !== "package.json" || typeof require(file).babel === "object") {
return file;
}
}
}
var up = path.dirname(start);
// Reached root
if (up !== start) {
return find(fileSystem, up);
}
};

View File

@@ -0,0 +1,13 @@
"use strict";
module.exports = function (fileSystem, filename) {
var exists = false;
try {
exists = fileSystem.statSync(filename).isFile();
} catch (err) {
if (err.code !== "ENOENT") throw err;
}
return exists;
};

View File

@@ -0,0 +1,14 @@
"use strict";
var path = require("path");
module.exports = function readBabelConfig(fileSystem, filename) {
if (path.basename(filename) === "package.json") {
var pkg = require(filename);
return JSON.stringify(pkg.babel);
}
// Webpack `fs` return Buffer
return fileSystem.readFileSync(filename).toString("utf8");
};

View File

@@ -0,0 +1,15 @@
"use strict";
var path = require("path");
module.exports = function relative(sourceRoot, filename) {
var rootPath = sourceRoot.replace(/\\/g, "/").split("/")[1];
var fileRootPath = filename.replace(/\\/g, "/").split("/")[1];
// If the file is in a completely different root folder use the absolute path of file.
if (rootPath && rootPath !== fileRootPath) {
return filename;
}
return path.relative(sourceRoot, filename);
};

View File

@@ -0,0 +1,150 @@
{
"_from": "babel-loader@^7.1.1",
"_id": "babel-loader@7.1.5",
"_inBundle": false,
"_integrity": "sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw==",
"_location": "/babel-loader",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "babel-loader@^7.1.1",
"name": "babel-loader",
"escapedName": "babel-loader",
"rawSpec": "^7.1.1",
"saveSpec": null,
"fetchSpec": "^7.1.1"
},
"_requiredBy": [
"/laravel-mix"
],
"_resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.5.tgz",
"_shasum": "e3ee0cd7394aa557e013b02d3e492bfd07aa6d68",
"_spec": "babel-loader@^7.1.1",
"_where": "D:\\developments\\teaser-inertia\\nova-components\\NovaLeader\\node_modules\\laravel-mix",
"author": {
"name": "Luis Couto",
"email": "hello@luiscouto.pt"
},
"ava": {
"files": [
"test/**/*.test.js",
"!test/fixtures/**/*",
"!test/helpers/**/*"
],
"source": [
"src/**/*.js"
],
"babel": "inherit"
},
"bugs": {
"url": "https://github.com/babel/babel-loader/issues"
},
"bundleDependencies": false,
"dependencies": {
"find-cache-dir": "^1.0.0",
"loader-utils": "^1.0.2",
"mkdirp": "^0.5.1"
},
"deprecated": false,
"description": "babel module loader for webpack",
"devDependencies": {
"ava": "^0.23.0",
"babel-cli": "^6.18.0",
"babel-core": "^6.0.0",
"babel-eslint": "^8.0.0",
"babel-plugin-istanbul": "^4.0.0",
"babel-plugin-react-intl": "^2.1.3",
"babel-preset-env": "^1.2.0",
"babel-register": "^6.18.0",
"cross-env": "^5.0.0",
"eslint": "^4.1.0",
"eslint-config-babel": "^7.0.0",
"eslint-plugin-flowtype": "^2.25.0",
"eslint-plugin-prettier": "^2.1.2",
"husky": "^0.14.0",
"lint-staged": "^4.0.0",
"nyc": "^11.0.1",
"prettier": "^1.2.2",
"react": "^16.0.0",
"react-intl": "^2.1.2",
"react-intl-webpack-plugin": "^0.0.3",
"rimraf": "^2.4.3",
"webpack": "^4.0.0"
},
"engines": {
"node": ">=4"
},
"files": [
"lib"
],
"homepage": "https://github.com/babel/babel-loader",
"keywords": [
"webpack",
"loader",
"babel",
"es6",
"transpiler",
"module"
],
"license": "MIT",
"lint-staged": {
"scripts/*.js": [
"prettier --trailing-comma es5 --write",
"git add"
],
"src/**/*.js": [
"prettier --trailing-comma all --write",
"git add"
],
"test/**/*.test.js": [
"prettier --trailing-comma all --write",
"git add"
],
"test/helpers/*.js": [
"prettier --trailing-comma all --write",
"git add"
],
"package.json": [
"node ./scripts/yarn-install.js",
"git add yarn.lock"
]
},
"main": "lib/index.js",
"name": "babel-loader",
"nyc": {
"all": true,
"include": [
"src/**/*.js"
],
"reporter": [
"text",
"json"
],
"require": [
"babel-register"
],
"sourceMap": false,
"instrument": false
},
"peerDependencies": {
"babel-core": "6",
"webpack": "2 || 3 || 4"
},
"repository": {
"type": "git",
"url": "git+https://github.com/babel/babel-loader.git"
},
"scripts": {
"build": "babel src/ --out-dir lib/",
"clean": "rimraf lib/",
"format": "prettier --write --trailing-comma all \"src/**/*.js\" \"test/**/*.test.js\" \"test/helpers/*.js\" && prettier --write --trailing-comma es5 \"scripts/*.js\"",
"lint": "eslint src test",
"precommit": "lint-staged",
"prepublish": "yarn run clean && yarn run build",
"preversion": "yarn run test",
"test": "yarn run lint && cross-env BABEL_ENV=test yarn run build && yarn run test-only",
"test-only": "nyc ava"
},
"version": "7.1.5"
}