Skip to content

Commit 4742c0d

Browse files
committed
fix prepublishOnly task, fixed DeprecationWarning in the styles scripts
1 parent e8b2b42 commit 4742c0d

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"lint": "prettier --write \"src/**/*.js\"",
1717
"make:combined-translation-keys": "babel-node utils/findTranslationKeys.js && babel-node utils/combineTranslationKeys.js",
1818
"make:translation-keys": "babel-node utils/findTranslationKeys.js",
19-
"make:lib": "mkdirp lib && babel src --out-dir lib --ignore=__tests__/* --source-maps && npm run make:lib:css",
19+
"make:lib": "mkdirp lib && babel src --out-dir lib --ignore=__tests__/* --source-maps && npm run make:lib:css && npm run make:lib:css:ie",
2020
"make:lib:css": "mkdirp lib && yarn styles:lib && yarn postcss:lib",
2121
"make:lib:css:ie": "mkdirp lib && yarn styles:lib:ie && yarn postcss:lib:ie",
2222
"make:dist": "mkdirp dist && browserify src/PlotlyEditor.js -o ./dist/PlotlyEditor.js -t [ babelify --presets [ es2015 react ] ] -t browserify-global-shim --standalone createPlotlyComponent && uglifyjs ./dist/PlotlyEditor.js --compress --mangle --output ./dist/PlotlyEditor.min.js --source-map filename=dist/PlotlyEditor.min.js.map && yarn make:dist:css",

scripts/postcss.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,16 @@ const internetExplorerPostCSS = () => {
3737
to: `${BUILD_ENV}/${fileName}.ie.min.css`,
3838
})
3939
.then(result => {
40-
fs.writeFile(`${BUILD_ENV}/${fileName}.ie.min.css`, result.css);
40+
fs.writeFile(
41+
`${BUILD_ENV}/${fileName}.ie.min.css`,
42+
result.css,
43+
error => {
44+
if (error) {
45+
/* eslint-disable no-console */
46+
console.log(error);
47+
}
48+
}
49+
);
4150
});
4251
});
4352
};
@@ -60,7 +69,12 @@ const defaultPostCSS = () => {
6069
to: `${BUILD_ENV}/${fileName}.min.css`,
6170
})
6271
.then(result => {
63-
fs.writeFile(`${BUILD_ENV}/${fileName}.min.css`, result.css);
72+
fs.writeFile(`${BUILD_ENV}/${fileName}.min.css`, result.css, error => {
73+
if (error) {
74+
/* eslint-disable no-console */
75+
console.log(error);
76+
}
77+
});
6478
});
6579
});
6680
};

scripts/styles.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ fs.readFile(src, function(err, data) {
3434
console.log(error.message);
3535
console.log(error.line);
3636
} else {
37-
fs.writeFile(dist, result.css);
37+
fs.writeFile(dist, result.css, error => {
38+
if (error) {
39+
/* eslint-disable no-console */
40+
console.log(error);
41+
}
42+
});
3843
}
3944
}
4045
);

0 commit comments

Comments
 (0)