1
0
mirror of synced 2025-11-06 04:21:11 +08:00

build: remove unnecessary files

This commit is contained in:
redhoodsu
2020-01-29 14:54:02 +08:00
parent e83590dc89
commit fdc13c2c61
5 changed files with 16 additions and 29 deletions

6
.gitignore vendored
View File

@@ -1,13 +1,9 @@
.idea/
dist/
node_modules/
test/lib/
coverage/
eustia/cache/
test/playground.html
eruda.js
!/test/eruda.js
!/src/eruda.js
eruda.js.map
/script/icomoon/
npm-debug.log
package-lock.json

View File

@@ -1,22 +0,0 @@
.github/
.vscode/
eustia/
.idea/
src/
coverage/
test/
doc/
/script/
.editorconfig
.eslintignore
.eslintrc.js
.gitignore
.gitattributes
.npmignore
.prettierignore
.eustia.js
.travis.yml
CHANGELOG.md
prettier.config.js
karma.conf.js
npm-debug.log

View File

@@ -5,7 +5,7 @@
"main": "eruda.js",
"scripts": {
"ci": "npm run lint && npm run test && npm run build",
"build": "webpack --config script/webpack.release.js",
"build": "webpack --config script/webpack.release.js && node script/build",
"build:analyser": "webpack --config script/webpack.analyser.js",
"dev": "webpack-dev-server --config script/webpack.dev.js --host 0.0.0.0",
"test": "karma start && remap-istanbul -i coverage/coverage-final.json -o coverage/coverage-remapped.json -t json && node script/coverage && shx rm src/index.js.map",

13
script/build.js Normal file
View File

@@ -0,0 +1,13 @@
const path = require('path')
const fs = require('licia/fs')
const pkg = require('../package.json')
delete pkg.scripts
delete pkg.devDependencies
fs.writeFile(
path.resolve(__dirname, '../dist/package.json'),
JSON.stringify(pkg, null, 2),
'utf8'
)

View File

@@ -36,7 +36,7 @@ module.exports = {
port: 3000
},
output: {
path: path.resolve(__dirname, '../'),
path: path.resolve(__dirname, '../dist'),
publicPath: '/assets/',
library: 'eruda',
libraryTarget: 'umd'