Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 함수
- Spinner
- 미니게임
- 왕초보
- 스프링
- 시큐어코딩
- Spring
- 상속
- 오버라이드
- React
- webpack
- snowpack
- git
- 스타일보험
- parcel
- kotlin
- 숫자
- FIle
- java#왕초보
- 안드로이드
- 쿠키
- Android
- 게시판
- sub query
- SQL
- 버전일치
- 코틀린
- 답글
- java
- degit
Archives
- Today
- Total
YSHUSH
개발환경설정(snowpack) 본문
npm init
npm i -D snowpack
npm i -D @snowpack/plugin-sass
npm i -D eslint
npm i --save-exact prettier
npm i -D eslint-config-prettier eslint-plugin-prettier
· 루트경로에 public, src 폴더를 만들고 public폴더에 index.html파일 생성, src폴더에 js폴더 - index.js, scss폴더 - style.scss생성 후 구조작성
index.html - dist폴더에서 css와 js를 import 해야한다.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="icon" href="./favicon.ico" />
<link rel="stylesheet" href="dist/scss/style.css" />
<title>Date Picker</title>
</head>
<body>
<script src="dist/js/index.js"></script>
</body>
</html>
· snowpack.config.js파일 생성 후
module.exports = {
mount: {
public: { url: "/", static: true },
src: { url: "/dist" },
},
optimize: {
minify: true,
},
plugins: ["@snowpack/plugin-sass"],
};
· package.json - scripts부분 수정
"scripts": {
"start": "snowpack dev",
"build": "snowpack build"
},
· .eslintrc.json 파일 생성 후
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"prettier/prettier": "error"
}
}
· .eslintignore 파일 생성 후
/node_modules
/build
snowpack.config.js
· .prettierrc.json 파일 생성 후
{
"trailingComma": "all",
"bracketSpacing": true,
"useTabs": false,
"semi": true,
"printWidth": 80,
"arrowParens": "avoid",
"proseWrap": "never",
"endOfLine": "auto",
"tabWidth": 2,
"singleQuote": true
}
· .prettierignore 파일 생성 후
/node_modules
/build
snowpack.config.js
· cmd + shift + p 누르고 settings 검색 후 preferences : Open Workspacee Settings(JSON) 열고 수정
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
· eslint, prettier - vscode 확장 설치
'Coding > Bundler' 카테고리의 다른 글
Webpack 개발환경 설정2 (0) | 2022.09.09 |
---|---|
Webpack 프로젝트 초기 구성 (0) | 2022.08.31 |
Parcel - babel (0) | 2022.08.31 |