nav tabs on admin dashboard
This commit is contained in:
210
node_modules/babel-loader/README.md
generated
vendored
210
node_modules/babel-loader/README.md
generated
vendored
@@ -1,43 +1,43 @@
|
||||
> This README is for babel-loader v8 + Babel v7
|
||||
> Check the [7.x branch](https://github.com/babel/babel-loader/tree/7.x) for docs with Babel v6
|
||||
|
||||
[](https://www.npmjs.com/package/babel-loader)
|
||||
[](https://travis-ci.org/babel/babel-loader)
|
||||
[](https://ci.appveyor.com/project/danez/babel-loader/branch/master)
|
||||
[](https://ci.appveyor.com/project/babel/babel-loader/branch/master)
|
||||
[](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 href="https://github.com/babel/babel">
|
||||
<img src="https://rawgit.com/babel/logo/master/babel.svg" alt="Babel logo" width="200" height="200">
|
||||
</a>
|
||||
<a href="https://github.com/webpack/webpack">
|
||||
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
|
||||
<img src="https://webpack.js.org/assets/icon-square-big.svg" alt="webpack logo" width="200" height="200">
|
||||
</a>
|
||||
<h1>Babel Loader</h1>
|
||||
</div>
|
||||
|
||||
<h1 align="center">Babel Loader</h1>
|
||||
|
||||
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).
|
||||
**Note**: Issues with the output should be reported on the Babel [Issues](https://github.com/babel/babel/issues) tracker.
|
||||
|
||||
<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
|
||||
> webpack 4.x | babel-loader 8.x | babel 7.x
|
||||
|
||||
```bash
|
||||
yarn add babel-loader babel-core babel-preset-env webpack --dev
|
||||
npm install -D babel-loader @babel/core @babel/preset-env webpack
|
||||
```
|
||||
|
||||
We recommend using yarn, but you can also still use npm:
|
||||
> webpack 4.x | babel-loader 7.x | babel 6.x
|
||||
|
||||
```bash
|
||||
npm install --save-dev babel-loader babel-core babel-preset-env webpack
|
||||
npm install -D babel-loader@7 babel-core babel-preset-env webpack
|
||||
```
|
||||
|
||||
<h2 align="center">Usage</h2>
|
||||
|
||||
[Documentation: Using loaders](https://webpack.js.org/loaders/)
|
||||
webpack documentation: [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:
|
||||
|
||||
@@ -45,12 +45,12 @@ Within your webpack configuration object, you'll need to add the babel-loader to
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
test: /\.m?js$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['env']
|
||||
presets: ['@babel/preset-env']
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,22 +60,21 @@ module: {
|
||||
|
||||
### Options
|
||||
|
||||
See the `babel` [options](https://babeljs.io/docs/usage/api/#options).
|
||||
See the `babel` [options](https://babeljs.io/docs/en/options).
|
||||
|
||||
|
||||
You can pass options to the loader by using the [options property](https://webpack.js.org/configuration/module/#rule-options-rule-query):
|
||||
You can pass options to the loader by using the [`options`](https://webpack.js.org/configuration/module/#rule-options-rule-query) property:
|
||||
|
||||
```javascript
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
test: /\.m?js$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['env'],
|
||||
plugins: [require('babel-plugin-transform-object-rest-spread')]
|
||||
presets: ['@babel/preset-env'],
|
||||
plugins: ['@babel/plugin-proposal-object-rest-spread']
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,62 +84,57 @@ module: {
|
||||
|
||||
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.
|
||||
* `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.
|
||||
* `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.
|
||||
* `cacheCompression`: Default `true`. When set, each Babel transform output will be compressed with Gzip. If you want to opt-out of cache compression, set it to `false` -- your project may benefit from this if it transpiles thousands of files.
|
||||
|
||||
__Note:__ The `sourceMap` option is ignored, instead sourceMaps are automatically enabled when webpack is configured to use them (via the `devtool` config option).
|
||||
* `customize`: Default `null`. The path of a module that exports a `custom` callback [like the one that you'd pass to `.custom()`](#customized-loader). Since you already have to make a new file to use this, it is recommended that you instead use `.custom` to create a wrapper loader. Only use this is you _must_ continue using `babel-loader` directly, but still want to customize.
|
||||
|
||||
## 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.
|
||||
Make sure you are transforming as few files as possible. Because you are probably matching `/\.m?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.
|
||||
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 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.
|
||||
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.
|
||||
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.
|
||||
The following configuration disables automatic per-file runtime injection in Babel, requiring `babel-plugin-transform-runtime` instead and making all helper references use it.
|
||||
|
||||
See the [docs](http://babeljs.io/docs/plugins/transform-runtime/) for more information.
|
||||
See the [docs](https://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`.
|
||||
**NOTE**: You must run `npm install -D @babel/plugin-transform-runtime` to include this in your project and `babel-runtime` itself as a dependency with `npm install @babel/runtime`.
|
||||
|
||||
```javascript
|
||||
rules: [
|
||||
// the 'transform-runtime' plugin tells babel to require the runtime
|
||||
// instead of inlining it.
|
||||
// the 'transform-runtime' plugin tells Babel to
|
||||
// require the runtime instead of inlining it.
|
||||
{
|
||||
test: /\.js$/,
|
||||
test: /\.m?js$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['env'],
|
||||
plugins: ['transform-runtime']
|
||||
presets: ['@babel/preset-env'],
|
||||
plugins: ['@babel/plugin-transform-runtime']
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
#### **NOTE:** transform-runtime & custom polyfills (e.g. Promise library)
|
||||
#### **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:
|
||||
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
|
||||
// ...
|
||||
@@ -153,7 +147,7 @@ Since [babel-plugin-transform-runtime](https://github.com/babel/babel/tree/maste
|
||||
The following approach will not work either:
|
||||
|
||||
```javascript
|
||||
require('babel-runtime/core-js/promise').default = require('bluebird');
|
||||
require('@babel/runtime/core-js/promise').default = require('bluebird');
|
||||
|
||||
var promise = new Promise;
|
||||
```
|
||||
@@ -163,9 +157,9 @@ which outputs to (using `runtime`):
|
||||
```javascript
|
||||
'use strict';
|
||||
|
||||
var _Promise = require('babel-runtime/core-js/promise')['default'];
|
||||
var _Promise = require('@babel/runtime/core-js/promise')['default'];
|
||||
|
||||
require('babel-runtime/core-js/promise')['default'] = require('bluebird');
|
||||
require('@babel/runtime/core-js/promise')['default'] = require('bluebird');
|
||||
|
||||
var promise = new _Promise();
|
||||
```
|
||||
@@ -177,32 +171,128 @@ One approach is to have a "bootstrap" step in your application that would first
|
||||
```javascript
|
||||
// bootstrap.js
|
||||
|
||||
require('babel-runtime/core-js/promise').default = require('bluebird');
|
||||
require('@babel/runtime/core-js/promise').default = require('bluebird');
|
||||
|
||||
// ...
|
||||
|
||||
require('./app');
|
||||
```
|
||||
|
||||
### The node API for `babel` has been moved to `babel-core`.
|
||||
### The Node.js 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
|
||||
If you receive this message, it means that you have the npm package `babel` installed and are using the short notation of the loader in the webpack config (which is not valid anymore as of webpack 2.x):
|
||||
```javascript
|
||||
{
|
||||
test: /\.js$/,
|
||||
test: /\.m?js$/,
|
||||
loader: 'babel',
|
||||
}
|
||||
```
|
||||
|
||||
Webpack then tries to load the `babel` package instead of the `babel-loader`.
|
||||
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`)
|
||||
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
|
||||
```javascript
|
||||
{
|
||||
test: /\.js$/,
|
||||
test: /\.m?js$/,
|
||||
loader: 'babel-loader',
|
||||
}
|
||||
```
|
||||
|
||||
## [License](http://couto.mit-license.org/)
|
||||
## Customized Loader
|
||||
|
||||
`babel-loader` exposes a loader-builder utility that allows users to add custom handling
|
||||
of Babel's configuration for each file that it processes.
|
||||
|
||||
`.custom` accepts a callback that will be called with the loader's instance of
|
||||
`babel` so that tooling can ensure that it using exactly the same `@babel/core`
|
||||
instance as the loader itself.
|
||||
|
||||
In cases where you want to customize without actually having a file to call `.custom`, you
|
||||
may also pass the `customize` option with a string pointing at a file that exports
|
||||
your `custom` callback function.
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
// Export from "./my-custom-loader.js" or whatever you want.
|
||||
module.exports = require("babel-loader").custom(babel => {
|
||||
function myPlugin() {
|
||||
return {
|
||||
visitor: {},
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
// Passed the loader options.
|
||||
customOptions({ opt1, opt2, ...loader }) {
|
||||
return {
|
||||
// Pull out any custom options that the loader might have.
|
||||
custom: { opt1, opt2 },
|
||||
|
||||
// Pass the options back with the two custom options removed.
|
||||
loader,
|
||||
};
|
||||
},
|
||||
|
||||
// Passed Babel's 'PartialConfig' object.
|
||||
config(cfg) {
|
||||
if (cfg.hasFilesystemConfig()) {
|
||||
// Use the normal config
|
||||
return cfg.options;
|
||||
}
|
||||
|
||||
return {
|
||||
...cfg.options,
|
||||
plugins: [
|
||||
...(cfg.options.plugins || []),
|
||||
|
||||
// Include a custom plugin in the options.
|
||||
myPlugin,
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
result(result) {
|
||||
return {
|
||||
...result,
|
||||
code: result.code + "\n// Generated by some custom loader",
|
||||
};
|
||||
},
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
```js
|
||||
// And in your Webpack config
|
||||
module.exports = {
|
||||
// ..
|
||||
module: {
|
||||
rules: [{
|
||||
// ...
|
||||
loader: path.join(__dirname, 'my-custom-loader.js'),
|
||||
// ...
|
||||
}]
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
### `customOptions(options: Object): { custom: Object, loader: Object }`
|
||||
|
||||
Given the loader's options, split custom options out of `babel-loader`'s
|
||||
options.
|
||||
|
||||
|
||||
### `config(cfg: PartialConfig): Object`
|
||||
|
||||
Given Babel's `PartialConfig` object, return the `options` object that should
|
||||
be passed to `babel.transform`.
|
||||
|
||||
|
||||
### `result(result: Result): Result`
|
||||
|
||||
Given Babel's result object, allow loaders to make additional tweaks to it.
|
||||
|
||||
|
||||
## License
|
||||
[MIT](https://couto.mit-license.org/)
|
||||
|
||||
180
node_modules/babel-loader/lib/fs-cache.js
generated
vendored
180
node_modules/babel-loader/lib/fs-cache.js
generated
vendored
@@ -1,180 +0,0 @@
|
||||
"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);
|
||||
};
|
||||
372
node_modules/babel-loader/lib/index.js
generated
vendored
372
node_modules/babel-loader/lib/index.js
generated
vendored
@@ -1,183 +1,221 @@
|
||||
"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");
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
||||
|
||||
/**
|
||||
* Error thrown by Babel formatted to conform to Webpack reporting.
|
||||
*/
|
||||
function BabelLoaderError(name, message, codeFrame, hideStack, error) {
|
||||
Error.call(this);
|
||||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
||||
|
||||
this.name = "BabelLoaderError";
|
||||
this.message = formatMessage(name, message, codeFrame);
|
||||
this.hideStack = hideStack;
|
||||
this.error = error;
|
||||
let babel;
|
||||
|
||||
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;
|
||||
try {
|
||||
babel = require("@babel/core");
|
||||
} catch (err) {
|
||||
if (err.code === "MODULE_NOT_FOUND") {
|
||||
err.message += "\n babel-loader@8 requires Babel 7.x (the package '@babel/core'). " + "If you'd like to use Babel 6.x ('babel-core'), you should install 'babel-loader@7'.";
|
||||
}
|
||||
|
||||
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 err;
|
||||
} // Since we've got the reverse bridge package at @babel/core@6.x, give
|
||||
// people useful feedback if they try to use it alongside babel-loader.
|
||||
|
||||
|
||||
if (/^6\./.test(babel.version)) {
|
||||
throw new Error("\n babel-loader@8 will not work with the '@babel/core@6' bridge package. " + "If you want to use Babel 6.x, install 'babel-loader@7'.");
|
||||
}
|
||||
|
||||
const pkg = require("../package.json");
|
||||
|
||||
const cache = require("./cache");
|
||||
|
||||
const transform = require("./transform");
|
||||
|
||||
const injectCaller = require("./injectCaller");
|
||||
|
||||
const path = require("path");
|
||||
|
||||
const loaderUtils = require("loader-utils");
|
||||
|
||||
function subscribe(subscriber, metadata, context) {
|
||||
if (context[subscriber]) {
|
||||
context[subscriber](metadata);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = makeLoader();
|
||||
module.exports.custom = makeLoader;
|
||||
|
||||
function makeLoader(callback) {
|
||||
const overrides = callback ? callback(babel) : undefined;
|
||||
return function (source, inputSourceMap) {
|
||||
// Make the loader async
|
||||
const callback = this.async();
|
||||
loader.call(this, source, inputSourceMap, overrides).then(args => callback(null, ...args), err => callback(err));
|
||||
};
|
||||
}
|
||||
|
||||
function loader(_x, _x2, _x3) {
|
||||
return _loader.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _loader() {
|
||||
_loader = _asyncToGenerator(function* (source, inputSourceMap, overrides) {
|
||||
const filename = this.resourcePath;
|
||||
let loaderOptions = loaderUtils.getOptions(this) || {};
|
||||
|
||||
if (loaderOptions.customize != null) {
|
||||
if (typeof loaderOptions.customize !== "string") {
|
||||
throw new Error("Customized loaders must be implemented as standalone modules.");
|
||||
}
|
||||
throw new BabelLoaderError(name, message, error.codeFrame, hideStack, error);
|
||||
} else {
|
||||
throw error;
|
||||
|
||||
if (!path.isAbsolute(loaderOptions.customize)) {
|
||||
throw new Error("Customized loaders must be passed as absolute paths, since " + "babel-loader has no way to know what they would be relative to.");
|
||||
}
|
||||
|
||||
if (overrides) {
|
||||
throw new Error("babel-loader's 'customize' option is not available when already " + "using a customized babel-loader wrapper.");
|
||||
}
|
||||
|
||||
let override = require(loaderOptions.customize);
|
||||
|
||||
if (override.__esModule) override = override.default;
|
||||
|
||||
if (typeof override !== "function") {
|
||||
throw new Error("Custom overrides must be functions.");
|
||||
}
|
||||
|
||||
overrides = override(babel);
|
||||
}
|
||||
}
|
||||
var code = result.code;
|
||||
var map = result.map;
|
||||
var metadata = result.metadata;
|
||||
|
||||
if (map && (!map.sourcesContent || !map.sourcesContent.length)) {
|
||||
map.sourcesContent = [source];
|
||||
}
|
||||
let customOptions;
|
||||
|
||||
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);
|
||||
if (overrides && overrides.customOptions) {
|
||||
const result = yield overrides.customOptions.call(this, loaderOptions, {
|
||||
source,
|
||||
map: inputSourceMap
|
||||
});
|
||||
customOptions = result.custom;
|
||||
loaderOptions = result.loader;
|
||||
} // Deprecation handling
|
||||
|
||||
return callback(null, code, map);
|
||||
});
|
||||
}
|
||||
|
||||
var _transpile = transpile(source, options),
|
||||
code = _transpile.code,
|
||||
map = _transpile.map,
|
||||
metadata = _transpile.metadata;
|
||||
if ("forceEnv" in loaderOptions) {
|
||||
console.warn("The option `forceEnv` has been removed in favor of `envName` in Babel 7.");
|
||||
}
|
||||
|
||||
metadataSubscribers.forEach(function (s) {
|
||||
return passMetadata(s, _this, metadata);
|
||||
if (typeof loaderOptions.babelrc === "string") {
|
||||
console.warn("The option `babelrc` should not be set to a string anymore in the babel-loader config. " + "Please update your configuration and set `babelrc` to true or false.\n" + "If you want to specify a specific babel config file to inherit config from " + "please use the `extends` option.\nFor more information about this options see " + "https://babeljs.io/docs/core-packages/#options");
|
||||
} // Standardize on 'sourceMaps' as the key passed through to Webpack, so that
|
||||
// users may safely use either one alongside our default use of
|
||||
// 'this.sourceMap' below without getting error about conflicting aliases.
|
||||
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(loaderOptions, "sourceMap") && !Object.prototype.hasOwnProperty.call(loaderOptions, "sourceMaps")) {
|
||||
loaderOptions = Object.assign({}, loaderOptions, {
|
||||
sourceMaps: loaderOptions.sourceMap
|
||||
});
|
||||
delete loaderOptions.sourceMap;
|
||||
}
|
||||
|
||||
const programmaticOptions = Object.assign({}, loaderOptions, {
|
||||
filename,
|
||||
inputSourceMap: inputSourceMap || undefined,
|
||||
// Set the default sourcemap behavior based on Webpack's mapping flag,
|
||||
// but allow users to override if they want.
|
||||
sourceMaps: loaderOptions.sourceMaps === undefined ? this.sourceMap : loaderOptions.sourceMaps,
|
||||
// Ensure that Webpack will get a full absolute path in the sourcemap
|
||||
// so that it can properly map the module back to its internal cached
|
||||
// modules.
|
||||
sourceFileName: filename
|
||||
}); // Remove loader related options
|
||||
|
||||
delete programmaticOptions.customize;
|
||||
delete programmaticOptions.cacheDirectory;
|
||||
delete programmaticOptions.cacheIdentifier;
|
||||
delete programmaticOptions.cacheCompression;
|
||||
delete programmaticOptions.metadataSubscribers;
|
||||
|
||||
if (!babel.loadPartialConfig) {
|
||||
throw new Error(`babel-loader ^8.0.0-beta.3 requires @babel/core@7.0.0-beta.41, but ` + `you appear to be using "${babel.version}". Either update your ` + `@babel/core version, or pin you babel-loader version to 8.0.0-beta.2`);
|
||||
}
|
||||
|
||||
const config = babel.loadPartialConfig(injectCaller(programmaticOptions));
|
||||
|
||||
if (config) {
|
||||
let options = config.options;
|
||||
|
||||
if (overrides && overrides.config) {
|
||||
options = yield overrides.config.call(this, config, {
|
||||
source,
|
||||
map: inputSourceMap,
|
||||
customOptions
|
||||
});
|
||||
}
|
||||
|
||||
if (options.sourceMaps === "inline") {
|
||||
// Babel has this weird behavior where if you set "inline", we
|
||||
// inline the sourcemap, and set 'result.map = null'. This results
|
||||
// in bad behavior from Babel since the maps get put into the code,
|
||||
// which Webpack does not expect, and because the map we return to
|
||||
// Webpack is null, which is also bad. To avoid that, we override the
|
||||
// behavior here so "inline" just behaves like 'true'.
|
||||
options.sourceMaps = true;
|
||||
}
|
||||
|
||||
const {
|
||||
cacheDirectory = null,
|
||||
cacheIdentifier = JSON.stringify({
|
||||
options,
|
||||
"@babel/core": transform.version,
|
||||
"@babel/loader": pkg.version
|
||||
}),
|
||||
cacheCompression = true,
|
||||
metadataSubscribers = []
|
||||
} = loaderOptions;
|
||||
let result;
|
||||
|
||||
if (cacheDirectory) {
|
||||
result = yield cache({
|
||||
source,
|
||||
options,
|
||||
transform,
|
||||
cacheDirectory,
|
||||
cacheIdentifier,
|
||||
cacheCompression
|
||||
});
|
||||
} else {
|
||||
result = yield transform(source, options);
|
||||
} // TODO: Babel should really provide the full list of config files that
|
||||
// were used so that this can also handle files loaded with 'extends'.
|
||||
|
||||
|
||||
if (typeof config.babelrc === "string") {
|
||||
this.addDependency(config.babelrc);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
if (overrides && overrides.result) {
|
||||
result = yield overrides.result.call(this, result, {
|
||||
source,
|
||||
map: inputSourceMap,
|
||||
customOptions,
|
||||
config,
|
||||
options
|
||||
});
|
||||
}
|
||||
|
||||
const {
|
||||
code,
|
||||
map,
|
||||
metadata
|
||||
} = result;
|
||||
metadataSubscribers.forEach(subscriber => {
|
||||
subscribe(subscriber, metadata, this);
|
||||
});
|
||||
return [code, map];
|
||||
}
|
||||
} // If the file was ignored, pass through the original content.
|
||||
|
||||
|
||||
return [source, inputSourceMap];
|
||||
});
|
||||
|
||||
this.callback(null, code, map);
|
||||
};
|
||||
return _loader.apply(this, arguments);
|
||||
}
|
||||
26
node_modules/babel-loader/lib/resolve-rc.js
generated
vendored
26
node_modules/babel-loader/lib/resolve-rc.js
generated
vendored
@@ -1,26 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
13
node_modules/babel-loader/lib/utils/exists.js
generated
vendored
13
node_modules/babel-loader/lib/utils/exists.js
generated
vendored
@@ -1,13 +0,0 @@
|
||||
"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;
|
||||
};
|
||||
14
node_modules/babel-loader/lib/utils/read.js
generated
vendored
14
node_modules/babel-loader/lib/utils/read.js
generated
vendored
@@ -1,14 +0,0 @@
|
||||
"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");
|
||||
};
|
||||
15
node_modules/babel-loader/lib/utils/relative.js
generated
vendored
15
node_modules/babel-loader/lib/utils/relative.js
generated
vendored
@@ -1,15 +0,0 @@
|
||||
"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);
|
||||
};
|
||||
77
node_modules/babel-loader/package.json
generated
vendored
77
node_modules/babel-loader/package.json
generated
vendored
@@ -1,26 +1,26 @@
|
||||
{
|
||||
"_from": "babel-loader@^7.1.1",
|
||||
"_id": "babel-loader@7.1.5",
|
||||
"_from": "babel-loader@^8.0.4",
|
||||
"_id": "babel-loader@8.0.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw==",
|
||||
"_integrity": "sha512-NTnHnVRd2JnRqPC0vW+iOQWU5pchDbYXsG2E6DMXEpMfUcQKclF9gmf3G3ZMhzG7IG9ji4coL0cm+FxeWxDpnw==",
|
||||
"_location": "/babel-loader",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "babel-loader@^7.1.1",
|
||||
"raw": "babel-loader@^8.0.4",
|
||||
"name": "babel-loader",
|
||||
"escapedName": "babel-loader",
|
||||
"rawSpec": "^7.1.1",
|
||||
"rawSpec": "^8.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^7.1.1"
|
||||
"fetchSpec": "^8.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/laravel-mix"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.5.tgz",
|
||||
"_shasum": "e3ee0cd7394aa557e013b02d3e492bfd07aa6d68",
|
||||
"_spec": "babel-loader@^7.1.1",
|
||||
"_resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.5.tgz",
|
||||
"_shasum": "225322d7509c2157655840bba52e46b6c2f2fe33",
|
||||
"_spec": "babel-loader@^8.0.4",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\laravel-mix",
|
||||
"author": {
|
||||
"name": "Luis Couto",
|
||||
@@ -32,48 +32,48 @@
|
||||
"!test/fixtures/**/*",
|
||||
"!test/helpers/**/*"
|
||||
],
|
||||
"source": [
|
||||
"sources": [
|
||||
"src/**/*.js"
|
||||
],
|
||||
"babel": "inherit"
|
||||
]
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel-loader/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"find-cache-dir": "^1.0.0",
|
||||
"find-cache-dir": "^2.0.0",
|
||||
"loader-utils": "^1.0.2",
|
||||
"mkdirp": "^0.5.1"
|
||||
"mkdirp": "^0.5.1",
|
||||
"util.promisify": "^1.0.0"
|
||||
},
|
||||
"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",
|
||||
"@babel/cli": "^7.2.0",
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/preset-env": "^7.2.0",
|
||||
"ava": "1.0.1",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-plugin-istanbul": "^5.1.0",
|
||||
"babel-plugin-react-intl": "^3.0.1",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "^5.9.0",
|
||||
"eslint-config-babel": "^8.0.2",
|
||||
"eslint-config-prettier": "^3.3.0",
|
||||
"eslint-plugin-flowtype": "^3.2.0",
|
||||
"eslint-plugin-prettier": "^3.0.0",
|
||||
"husky": "^1.2.0",
|
||||
"lint-staged": "^8.1.0",
|
||||
"nyc": "^13.1.0",
|
||||
"prettier": "^1.15.3",
|
||||
"react": "^16.0.0",
|
||||
"react-intl": "^2.1.2",
|
||||
"react-intl-webpack-plugin": "^0.0.3",
|
||||
"react-intl-webpack-plugin": "^0.3.0",
|
||||
"rimraf": "^2.4.3",
|
||||
"webpack": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
"node": ">= 6.9"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
@@ -121,15 +121,12 @@
|
||||
"text",
|
||||
"json"
|
||||
],
|
||||
"require": [
|
||||
"babel-register"
|
||||
],
|
||||
"sourceMap": false,
|
||||
"instrument": false
|
||||
},
|
||||
"peerDependencies": {
|
||||
"babel-core": "6",
|
||||
"webpack": "2 || 3 || 4"
|
||||
"@babel/core": "^7.0.0",
|
||||
"webpack": ">=2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -138,7 +135,7 @@
|
||||
"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\"",
|
||||
"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",
|
||||
@@ -146,5 +143,5 @@
|
||||
"test": "yarn run lint && cross-env BABEL_ENV=test yarn run build && yarn run test-only",
|
||||
"test-only": "nyc ava"
|
||||
},
|
||||
"version": "7.1.5"
|
||||
"version": "8.0.5"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user