Merge pull request #1981 from MartijnCuppens/npm-files

Switch from `.npmignore` to `files` option
This commit is contained in:
Adam Wathan 2020-06-29 07:24:43 -04:00 • committed by GitHub
commit a052332816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 9 deletions

View file

@ -1,5 +0,0 @@
/__tests__/
/jest/
/src/
index.html
yarn-error.log

View file

@ -25,6 +25,14 @@
"style": "eslint .",
"test": "jest && eslint ."
},
"files": [
"dist/*.css",
"lib/*",
"scripts/*.js",
"stubs/*.stub.js",
"*.css",
"*.js"
],
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",

View file

@ -14,13 +14,9 @@ function buildDistFile(filename) {
.process(css, {
from: `./${filename}.css`,
to: `./dist/${filename}.css`,
map: { inline: false },
})
.then(result => {
fs.writeFileSync(`./dist/${filename}.css`, result.css)
if (result.map) {
fs.writeFileSync(`./dist/${filename}.css.map`, result.map)
}
return result
})
.then(result => {