forked from mirrors/keywind
feat!: migrate from snowpack to vite
This commit is contained in:
parent
49bdda4ca9
commit
0174eeba49
13 changed files with 400 additions and 3106 deletions
19
package.json
19
package.json
|
@ -1,20 +1,19 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/package",
|
||||
"scripts": {
|
||||
"build": "snowpack build",
|
||||
"build": "tsc && vite build",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"alpinejs": "^3.9.5"
|
||||
"alpinejs": "^3.10.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@snowpack/plugin-postcss": "^1.4.3",
|
||||
"@tailwindcss/forms": "^0.5.0",
|
||||
"@types/tailwindcss": "^3.0.10",
|
||||
"autoprefixer": "^10.4.4",
|
||||
"cssnano": "^5.1.7",
|
||||
"postcss": "^8.4.12",
|
||||
"snowpack": "^3.8.8",
|
||||
"tailwindcss": "^3.0.23"
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@types/alpinejs": "^3.7.0",
|
||||
"autoprefixer": "^10.4.8",
|
||||
"postcss": "^8.4.16",
|
||||
"tailwindcss": "^3.1.8",
|
||||
"typescript": "^4.8.2",
|
||||
"vite": "^3.0.9"
|
||||
}
|
||||
}
|
||||
|
|
3393
pnpm-lock.yaml
3393
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,6 @@
|
|||
module.exports = {
|
||||
plugins: {
|
||||
autoprefixer: {},
|
||||
cssnano: {},
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* @type { import("snowpack").SnowpackUserConfig }
|
||||
*/
|
||||
module.exports = {
|
||||
buildOptions: {
|
||||
out: './theme/keywind/login/resources',
|
||||
},
|
||||
devOptions: {
|
||||
tailwindConfig: './tailwind.config.js',
|
||||
},
|
||||
mount: {
|
||||
src: '/dist',
|
||||
},
|
||||
optimize: {
|
||||
bundle: true,
|
||||
entrypoints: ['./src/index.js'],
|
||||
minify: true,
|
||||
target: 'es2017',
|
||||
},
|
||||
plugins: ['@snowpack/plugin-postcss'],
|
||||
};
|
7
src/global.d.ts
vendored
Normal file
7
src/global.d.ts
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
import type { Alpine } from 'alpinejs';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
Alpine: Alpine;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
import Alpine from 'alpinejs';
|
||||
|
||||
import './index.css';
|
||||
|
||||
window.Alpine = Alpine;
|
||||
|
||||
Alpine.start();
|
|
@ -1,7 +1,7 @@
|
|||
const colors = require('tailwindcss/colors');
|
||||
|
||||
/**
|
||||
* @type { import('@types/tailwindcss/tailwind-config').TailwindConfig }
|
||||
* @type { import('tailwindcss/types').Config }
|
||||
*/
|
||||
module.exports = {
|
||||
content: ['./theme/**/*.ftl'],
|
||||
|
|
2
theme/keywind/login/resources/dist/index.css
vendored
2
theme/keywind/login/resources/dist/index.css
vendored
File diff suppressed because one or more lines are too long
5
theme/keywind/login/resources/dist/index.js
vendored
5
theme/keywind/login/resources/dist/index.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
21
tsconfig.json
Normal file
21
tsconfig.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"isolatedModules": true,
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"noEmit": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
10
tsconfig.node.json
Normal file
10
tsconfig.node.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"composite": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
14
vite.config.ts
Normal file
14
vite.config.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: 'src/index.ts',
|
||||
output: {
|
||||
assetFileNames: '[name][extname]',
|
||||
dir: 'theme/keywind/login/resources/dist',
|
||||
entryFileNames: '[name].js',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
Loading…
Reference in a new issue