diff --git a/babel.config.js b/babel.config.js index 54014797..d4b1aea9 100644 --- a/babel.config.js +++ b/babel.config.js @@ -2,5 +2,13 @@ module.exports = { presets: [ '@vue/app', '@babel/preset-env' - ] + ], + env: { + development: { + plugins: ['transform-es2015-modules-commonjs'] + }, + test: { + plugins: ['transform-es2015-modules-commonjs'] + } + } } diff --git a/jest.config.js b/jest.config.js index f9d8a363..88549dcc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -11,7 +11,7 @@ module.exports = { '^.+\\.(js|jsx)?$': 'babel-jest' }, transformIgnorePatterns: [ - '/node_modules/' + '/node_modules/(?!lodash-es)' ], moduleNameMapper: { '^@/(.*)$': '/src/$1' diff --git a/package.json b/package.json index 56a761c3..a67265a2 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ }, "devDependencies": { "@babel/core": "^7.6.0", + "@babel/plugin-transform-modules-commonjs": "^7.6.0", "@commitlint/cli": "^8.2.0", "@commitlint/config-conventional": "^8.2.0", "@storybook/addon-actions": "^5.2.1", diff --git a/src/components/Button/button.test.js b/src/components/Button/button.test.js index a397c7c6..dd77ce6f 100644 --- a/src/components/Button/button.test.js +++ b/src/components/Button/button.test.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils' -import Button from '../../lib/core/' +import Button from '../Button' import Theme from '../../../kiwi.config' describe('===== Button Component =====', () => {