-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
896 additions
and
1,526 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import eslint from '@antfu/eslint-config' | ||
|
||
export default [ | ||
...eslint(), | ||
{ | ||
rules: { | ||
'no-console': 'off', | ||
'node/prefer-global/process': 'off', | ||
'style/space-before-function-paren': ['error', 'always'], | ||
'antfu/if-newline': 'off', | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { Controller } from '@hotwired/stimulus' | ||
|
||
export default class extends Controller { | ||
connect() { | ||
connect () { | ||
console.log('Home 🏠', this.element) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { Controller } from '@hotwired/stimulus' | ||
|
||
export default class extends Controller { | ||
connect() { | ||
connect () { | ||
console.log('Stimulus with Vite.js ⚡️', this.element) | ||
this.originalText = this.element.textContent | ||
this.element.textContent = 'Stimulus with Vite.js' | ||
} | ||
|
||
disconnect() { | ||
disconnect () { | ||
this.element.textContent = this.originalText | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { defineConfig } from 'vite' | ||
import { defineConfig, splitVendorChunkPlugin } from 'vite' | ||
import StimulusHMR from 'vite-plugin-stimulus-hmr' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
splitVendorChunkPlugin(), | ||
StimulusHMR(), | ||
], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,15 @@ | ||
{ | ||
"name": "vite-plugin-stimulus-hmr", | ||
"description": "HMR for Stimulus controllers in Vite.js, tweak your JS without refreshing the page.", | ||
"version": "3.0.0", | ||
"files": [ | ||
"dist" | ||
], | ||
"sideEffects": false, | ||
"type": "module", | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
} | ||
}, | ||
"license": "MIT", | ||
"version": "3.0.0", | ||
"description": "HMR for Stimulus controllers in Vite.js, tweak your JS without refreshing the page.", | ||
"author": "Máximo Mussini <[email protected]>", | ||
"license": "MIT", | ||
"homepage": "https://github.com/ElMassimo/vite-plugin-stimulus-hmr", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ElMassimo/vite-plugin-stimulus-hmr" | ||
}, | ||
"homepage": "https://github.com/ElMassimo/vite-plugin-stimulus-hmr", | ||
"bugs": "https://github.com/ElMassimo/vite-plugin-stimulus-hmr/issues", | ||
"keywords": [ | ||
"plugin", | ||
|
@@ -35,6 +21,20 @@ | |
"vite-plugin", | ||
"vitejs" | ||
], | ||
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"lint": "eslint .", | ||
"test": "vitest --config example/vite.config.ts", | ||
|
@@ -51,11 +51,12 @@ | |
"stimulus-vite-helpers": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"@mussi/eslint-config": "^0.5.1", | ||
"@antfu/eslint-config": "^1.1.4", | ||
"@types/debug": "^4.1.12", | ||
"@types/node": "^18.18.9", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"eslint": "^7.32.0", | ||
"@typescript-eslint/eslint-plugin": "^6.10.0", | ||
"eslint": "^8.53.0", | ||
"eslint-define-config": "^1.24.1", | ||
"fast-glob": "^3.3.2", | ||
"happy-dom": "^2.55.0", | ||
"rollup": "^4.4.1", | ||
|
@@ -64,10 +65,5 @@ | |
"typescript": "^4.9.5", | ||
"vite": "^5.0.0", | ||
"vitest": "^0.34.6" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"@mussi/eslint-config" | ||
] | ||
} | ||
} |
Oops, something went wrong.