diff --git a/README.md b/README.md index 4f7f887..50fe4b6 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,26 @@ import 'echarts/lib/component/tooltip' // register component to use ``` -**Heads up** +#### Heads up #### + +(This may not be a problem any more if you are scaffolding your project using the `webpack` template after [this commit](https://github.com/vuejs-templates/webpack/commit/49456eb8c53252d6d238cc0e27e3bcfd6732e1a5). From now on you can directly import `vue-echarts/components/ECharts` with ease.) + +If you are using `vue-cli` to create your project and you want to use the untranspiled component (import `vue-echarts/components/ECharts` rather than import `vue-echarts` directly, to optimize bundle size), the `webpack` template may exclude `node_modules` from files to be transpiled by Babel. To fix this problem, try change `build/webpack.base.conf.js` like this: + +```diff + { + test: /\.js$/, + loader: 'babel', + include: [ +- path.join(projectRoot, 'src') ++ path.join(projectRoot, 'src'), ++ path.join(projectRoot, 'node_modules/vue-echarts') + ], +- exclude: /node_modules/ ++ exclude: /node_modules(?![\\/]vue-echarts[\\/])/ + }, +``` -if you are using `vue-cli` to create your project, the `webpack` template may exclude `node_modules` from files to be transpiled by Babel. Change the `exclude` value from `/node_modules/` to `/node_modules(?![\\/]vue-echarts[\\/])/` to fix the problem. ### CommonJS with NPM without ES Next support diff --git a/package.json b/package.json index e70693d..8a6d1c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-echarts", - "version": "2.2.0", + "version": "2.3.0", "description": "ECharts component for Vue.js.", "main": "dist/vue-echarts.js", "scripts": {