Browse Source

Add babel support

Yaroslav Kasperovich 5 years ago
parent
commit
550f3a4c6c
4 changed files with 886 additions and 7 deletions
  1. 1 0
      README.md
  2. 9 0
      index.js
  3. 4 1
      package.json
  4. 872 6
      yarn.lock

+ 1 - 0
README.md

@@ -5,6 +5,7 @@ CoffeeScript2 support for the projects created with [@vue/cli](https://github.co
 With built-in:
 * `cache-loader`
 * `thread-loader`
+* `babel-loader`
 * `src/main.coffee` support if you're not using `config.pages`
 
 ## Installation

+ 9 - 0
index.js

@@ -20,6 +20,15 @@ module.exports = (API, projectOptions) => {
         );
     }
 
+    if (api.hasPlugin("babel")) {
+      coffeeRule
+        .use("babel-loader")
+        .loader(require.resolve("babel-loader"))
+        .options({
+          presets: ["@babel/preset-env"],
+        });
+    }
+
     coffeeRule.use("coffee-loader").loader(require.resolve("coffee-loader"));
   });
 };

+ 4 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "vue-cli-plugin-coffee",
-  "version": "0.4.0",
+  "version": "0.5.0",
   "description": "CoffeeScript2 support for your @vue/cli project",
   "main": "index.js",
   "repository": {
@@ -27,6 +27,9 @@
     "prettier": "^2.0.5"
   },
   "dependencies": {
+    "@babel/core": "^7.9.6",
+    "@babel/preset-env": "^7.9.6",
+    "babel-loader": "^8.1.0",
     "cache-loader": "^4.1.0",
     "coffee-loader": "^1.0.0",
     "thread-loader": "^2.1.3"

File diff suppressed because it is too large
+ 872 - 6
yarn.lock


Some files were not shown because too many files changed in this diff