はい!今やってます!

Work Pertly, Live Idly

svelte, ts, tailwindアプリ環境を最速で作りたくなった時に叩くコマンド

  • command
npx degit sveltejs/template ${project_name}
yarn install
node scripts/setupTypeScript.js
yarn add svelte-check
yarn svelte-check
yarn add tailwindcss@latest postcss@latest autoprefixer@latest
yarn add svelte-preprocess
npx tailwindcss init
  • tailwind.config.js
const production = !process.env.ROLLUP_WATCH; // Add
module.exports = {
  // Add from here
  purge: {
    content: [
      './src/**/*.svelte',
      './src/**/*.html',
    ],
    enabled: production, // disable purge in dev
  },
  // Add to here
};
  • rollup.config.js
import sveltePreprocess from 'svelte-preprocess'; // Add

// 中略

export default {
  plugins: [
    svelte({
      // Add from here
      preprocess: sveltePreprocess({
        sourceMap: !production,
        postcss: {
          plugins: [
            require('tailwindcss'),
            require('autoprefixer'),
          ],
        },
      }),
      // Add to here
    
     // 中略
};
yarn run dev