Przeglądaj źródła

Change Laravel Mix to Microbundle

Caleb Porzio 5 lat temu
rodzic
commit
9ac9041de0
14 zmienionych plików z 163 dodań i 2226 usunięć
  1. 2 4
      README.md
  2. 0 1570
      dist/alpine.js
  3. 0 0
      dist/alpine.js.map
  4. 0 0
      dist/alpine.min.js
  5. 0 0
      dist/alpine.mjs
  6. 0 0
      dist/alpine.mjs.map
  7. 0 0
      dist/alpine.umd.js
  8. 0 0
      dist/alpine.umd.js.map
  9. 0 4
      dist/mix-manifest.json
  10. 1 1
      index.html
  11. 151 606
      package-lock.json
  12. 8 19
      package.json
  13. 1 1
      src/index.js
  14. 0 21
      webpack.mix.js

+ 2 - 4
README.md

@@ -12,7 +12,7 @@ Think of it like [Tailwind](https://tailwindcss.com/) for JavaScript.
 
 
 **From CDN:** Add the following script to the end of your `<head>` section.
 **From CDN:** Add the following script to the end of your `<head>` section.
 ```html
 ```html
-<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v1.1.1/dist/alpine.min.js" defer></script>
+<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v1.1.2/dist/alpine.umd.js" defer></script>
 ```
 ```
 
 
 That's it. It will initialize itself.
 That's it. It will initialize itself.
@@ -22,11 +22,9 @@ That's it. It will initialize itself.
 npm i alpinejs
 npm i alpinejs
 ```
 ```
 
 
-Include, and start it in your scripts:
+Include it in your script.
 ```js
 ```js
 import Alpine from 'alpinejs'
 import Alpine from 'alpinejs'
-
-Alpine.start()
 ```
 ```
 
 
 For IE11, polyfills will need to be provided. Please load the following scripts before the Alpine script above.
 For IE11, polyfills will need to be provided. Please load the following scripts before the Alpine script above.

Plik diff jest za duży
+ 0 - 1570
dist/alpine.js


Plik diff jest za duży
+ 0 - 0
dist/alpine.js.map


Plik diff jest za duży
+ 0 - 0
dist/alpine.min.js


Plik diff jest za duży
+ 0 - 0
dist/alpine.mjs


Plik diff jest za duży
+ 0 - 0
dist/alpine.mjs.map


Plik diff jest za duży
+ 0 - 0
dist/alpine.umd.js


Plik diff jest za duży
+ 0 - 0
dist/alpine.umd.js.map


+ 0 - 4
dist/mix-manifest.json

@@ -1,4 +0,0 @@
-{
-    "/alpine.min.js": "/alpine.min.js?id=6596bbe10c6e799d6058",
-    "/alpine.js": "/alpine.js?id=7e232940b8cde263a3a7"
-}

+ 1 - 1
index.html

@@ -5,7 +5,7 @@
             [x-cloak] { display: none; }
             [x-cloak] { display: none; }
         </style>
         </style>
 
 
-        <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v1.1.1/dist/alpine.min.js" defer></script>
+        <script src="/dist/alpine.umd.js" defer></script>
     </head>
     </head>
     <body>
     <body>
         <table>
         <table>

Plik diff jest za duży
+ 151 - 606
package-lock.json


+ 8 - 19
package.json

@@ -1,39 +1,28 @@
 {
 {
   "main": "dist/alpine.js",
   "main": "dist/alpine.js",
   "name": "alpinejs",
   "name": "alpinejs",
-  "version": "1.1.1",
+  "version": "1.1.2",
   "repository": {
   "repository": {
     "type": "git",
     "type": "git",
     "url": "git://github.com/alpinejs/alpine.git"
     "url": "git://github.com/alpinejs/alpine.git"
   },
   },
   "scripts": {
   "scripts": {
+    "watch": "npx microbundle watch src/index.js",
+    "build": "npx microbundle build src/index.js",
     "test": "npx jest",
     "test": "npx jest",
-    "test:debug": "node --inspect node_modules/.bin/jest --runInBand",
-    "unminified": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
-    "minified": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
-    "watch": "npm run unminified -- --watch",
-    "build": "npm run unminified && npm run minified"
+    "test:debug": "node --inspect node_modules/.bin/jest --runInBand"
   },
   },
   "author": "Caleb Porzio",
   "author": "Caleb Porzio",
   "license": "MIT",
   "license": "MIT",
   "devDependencies": {
   "devDependencies": {
-    "@babel/cli": "^7.7.5",
-    "@babel/core": "^7.7.5",
-    "@babel/preset-env": "^7.7.6",
-    "@testing-library/dom": "^6.10.1",
+    "@babel/preset-env": "^7.7.7",
+    "@testing-library/dom": "^6.11.0",
     "@testing-library/jest-dom": "^4.2.4",
     "@testing-library/jest-dom": "^4.2.4",
     "babel-jest": "^24.8.0",
     "babel-jest": "^24.8.0",
-    "cross-env": "^5.2.0",
-    "cross-spawn": "^6.0.5",
-    "false": "^0.0.4",
-    "get-value": "^3.0.1",
     "jest": "^24.8.0",
     "jest": "^24.8.0",
     "jsdom-simulant": "^1.1.2",
     "jsdom-simulant": "^1.1.2",
-    "laravel-mix": "^5.0.0",
-    "laravel-mix-merge-manifest": "^0.1.2",
-    "mock-echo": "^1.1.0",
-    "promise-polyfill": "^8.1.3",
-    "vue-template-compiler": "^2.6.10"
+    "microbundle": "^0.11.0",
+    "mock-echo": "^1.1.0"
   },
   },
   "dependencies": {}
   "dependencies": {}
 }
 }

+ 1 - 1
src/index.js

@@ -71,7 +71,7 @@ const Alpine = {
     }
     }
 }
 }
 
 
-if (window !== undefined && ! window.Alpine && ! isTesting()) {
+if (! isTesting()) {
     window.Alpine = Alpine
     window.Alpine = Alpine
     window.Alpine.start()
     window.Alpine.start()
 }
 }

+ 0 - 21
webpack.mix.js

@@ -1,21 +0,0 @@
-let mix = require('laravel-mix');
-
-// Allow both "alpine.js" && "alpine.min.js"
-// to both exist in the mix.manifest file.
-require('laravel-mix-merge-manifest');
-
-const outputFileName = process.env.NODE_ENV === 'production'
-    ? 'alpine.min.js'
-    : 'alpine.js'
-
-mix
-    .js('src/index.js', outputFileName)
-    .setPublicPath('dist')
-    .version()
-    .mergeManifest();
-
-mix.webpackConfig({
-    output: {
-        libraryTarget: 'umd',
-    }
-});

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików