소스 검색

Add babel support

Yaroslav Kasperovich 5 년 전
부모
커밋
550f3a4c6c
4개의 변경된 파일886개의 추가작업 그리고 7개의 파일을 삭제
  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"

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 872 - 6
yarn.lock


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.