nupolyon

polyfill.ioからNuxtプロジェクトにポリフィルを注入し、browserslistの設定に基づいて自動検出

Nupolyon

npm versionnpm downloadsLicense

https://cdnjs.cloudflare.com/polyfill/ からポリフィルを自動注入

⚠️ 警告

このモジュールを使用しないでください。POLYFILL.IOが悪意のあるコードを注入していると報告されています。一時的にURLをCLOUDFLAREのミラーに移動しました。

https://www.bleepingcomputer.com/news/security/polyfillio-javascript-supply-chain-attack-impacts-over-100k-sites/

https://sansec.io/research/polyfill-supply-chain-attack

https://www.theregister.com/2024/06/25/polyfillio_china_crisis/

https://www.scmagazine.com/brief/over-100k-sites-hit-by-polyfill-io-supply-chain-attack

機能

詳細な機能説明はこちらを参照してください: #58 (コメント)

クイックセットアップ

  1. プロジェクトにnupolyonの依存関係を追加
npx nuxi@latest module add nupolyon
  1. nuxt.config.tsmodulesセクションにnupolyonを追加
export default defineNuxtConfig({
  modules: [
    'nupolyon'
  ]
})

これだけです!これでNuxtアプリでNupolyonを使用できます✨

設定

export default defineNuxtConfig({
  modules: [
    'nupolyon'
  ],
  nupolyon: {
    // change host
    host: 'http://my-own-cdn.com/polyfill.min.js'
    // or enable self-host mode
    host: 'selfhost'

    // customize browserslist's target
    target: 'defaults'
  },
})

開発

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

ライセンス

このプロジェクトはMITライセンスの下で公開されています。詳細についてはLICENSEを参照してください。