mirror of
https://gitee.com/dcloud/uni-preset-vue
synced 2025-04-26 23:10:13 +08:00
fix: rename and update .gitignore
This commit is contained in:
parent
a46b69d0a2
commit
7ebb55da28
10
generator.js
10
generator.js
@ -13,14 +13,18 @@ async function generate(dir, files, base = '') {
|
||||
nodir: true
|
||||
}).forEach(rawPath => {
|
||||
const sourcePath = path.resolve(dir, rawPath)
|
||||
const filename = path.join(base, rawPath)
|
||||
|
||||
if (isBinary.sync(sourcePath)) {
|
||||
files[path.join(base, rawPath)] = fs.readFileSync(sourcePath) // return buffer
|
||||
files[filename] = fs.readFileSync(sourcePath) // return buffer
|
||||
} else {
|
||||
const content = fs.readFileSync(sourcePath, 'utf-8')
|
||||
if (sourcePath.indexOf('manifest.json') !== -1 || sourcePath.indexOf('pages.json') !== -1) {
|
||||
files[path.join(base, rawPath)] = JSON.stringify(JSON.parse(stripJsonComments(content)), null, 2)
|
||||
files[filename] = JSON.stringify(JSON.parse(stripJsonComments(content)), null, 2)
|
||||
} else if (filename.charAt(0) === '_' && filename.charAt(1) !== '_') {
|
||||
files[`.${filename.slice(1)}`] = content
|
||||
} else {
|
||||
files[path.join(base, rawPath)] = content
|
||||
files[filename] = content
|
||||
}
|
||||
}
|
||||
})
|
||||
|
10
template/common/.gitignore
vendored
10
template/common/.gitignore
vendored
@ -1,10 +0,0 @@
|
||||
.DS_Store
|
||||
.project
|
||||
.vscode
|
||||
|
||||
node_modules/
|
||||
unpackage/
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
22
template/common/_gitignore
Normal file
22
template/common/_gitignore
Normal file
@ -0,0 +1,22 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
unpackage/
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.project
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
Loading…
x
Reference in New Issue
Block a user