Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
Version 1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Mar 9, 2019
1 parent 1bcc67e commit 4eb5e6c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@

This plugin allows to have normal `.babelrc` file with your `nuxt` app!

While traditional `nuxt` app [requires](https://nuxtjs.org/api/configuration-build/#babel) that you specify all your `babel`
configuration inside the `nuxt.config.js`, some other tools (like `jest`) require [the traditional approach](https://babeljs.io/docs/usage/babelrc/) with `.babelrc`.

This plugin gracefully injects your `.babelrc` into your `nuxt` configuration allowing you to have the best from both worlds.

We also support `package.json` and `.babelrc.js` files.
While traditional `nuxt` app
[requires](https://nuxtjs.org/api/configuration-build/#babel)
that you specify all your `babel`
configuration inside the `nuxt.config.js`,
some other tools (like `jest`)
require [the traditional approach](https://babeljs.io/docs/usage/babelrc/)
with `.babelrc`.

This plugin gracefully injects your `.babelrc` into your `nuxt` configuration
allowing you to have the best from both worlds.

We also support `.babelrc.js`, `babel.config.js`, and `package.json` files.


## Installation
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt-babel",
"version": "0.1.2",
"version": "1.0.0",
"description": "This plugin allows to have normal .babelrc file with your Nuxt app",
"main": "lib/index.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions tests/fixtures/with-babel-config-js/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: 'env'
}
5 changes: 5 additions & 0 deletions tests/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ describe('nuxt-babel', () => {
expect(context.options.build.babel).toEqual({ presets: 'env' })
})

it('with babel.config.js', () => {
bound({ directory: resolveFixture('with-babel-config-js') })
expect(context.options.build.babel).toEqual({ presets: 'env' })
})

it('without babel files', () => {
bound({ directory: resolveFixture('without') })

Expand Down

0 comments on commit 4eb5e6c

Please sign in to comment.