0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Laravel Bootstrap(Viteでの使用)/新規追加機能

Posted at

npm install
npm install vite
npm install bootstrap @popperjs/core
npm install sass
プロジェクト構造.
my-project/
├── src/
│   ├── js/
│   │   └── main.js
│   └── scss/
│   │   └── styles.scss
│   └── index.html
├── package-lock.json
├── package.json
└── vite.config.js
scss/styles.scss
// BootstrapのCSSをすべてインポート
@import "~bootstrap/scss/bootstrap";
js/main.js
// カスタムCSSをインポート
import '../scss/styles.scss'
// BootstrapのJSをすべてインポート
import * as bootstrap from 'bootstrap'
vite.config.js
const path = require('path')
export default {
  root: path.resolve(__dirname, 'src'),
  resolve: {
    alias: {
      '~bootstrap': path.resolve(__dirname, 'node_modules/bootstrap'),
    }
  },
  server: {
    port: 8080,
    hot: true
  }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?