* carbon-ads

* fixes #68

* fixes

* fixes #70
This commit is contained in:
Ritesh Kumar authored and GitHub committed 2018-03-27 02:00:07 +05:30
1 parent 09a479b279
commit 7ab8b321c7
5 files changed
+39 -29

No files matched your search

+17 -17
View File
@@ -28,23 +28,23 @@ module.exports = {
"babel-core": "babel-standalone"
};
if (!dev) {
config.plugins.push(
new SWPrecacheWebpackPlugin({
minify: true,
staticFileGlobsIgnorePatterns: [/\.next\//],
staticFileGlobs: [
"static/**/*" // Precache all static files by default
],
runtimeCaching: [
{
handler: "networkFirst",
urlPattern: /^https?.*/
}
]
})
);
}
// if (!dev) {
// config.plugins.push(
// new SWPrecacheWebpackPlugin({
// minify: true,
// staticFileGlobsIgnorePatterns: [/\.next\//],
// staticFileGlobs: [
// "static/**/*" // Precache all static files by default
// ],
// runtimeCaching: [
// {
// handler: "networkFirst",
// urlPattern: /^https?.*/
// }
// ]
// })
// );
// }
if (ANALYZE) {
config.plugins.push(
+1 -2
View File
@@ -5,8 +5,7 @@
"main": "index.js",
"scripts": {
"start": "next start",
"build":
"rm -rf out && next build && next export -o transform && cp ./.next/service-worker.js ./transform/service-worker.js",
"build": "rm -rf out && next build && next export -o transform",
"dev": "next dev",
"addContributor": "all-contributors add",
"analyze": "cross-env ANALYZE=1 next build",
+14 -8
View File
@@ -26,14 +26,20 @@ export default class Main extends PureComponent {
componentDidMount() {
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register("/service-worker.js")
.then(registration => {
console.log("service worker registration successful");
})
.catch(err => {
console.warn("service worker registration failed");
});
// navigator.serviceWorker
// .register("/service-worker.js")
// .then(registration => {
// console.log("service worker registration successful");
// })
// .catch(err => {
// console.warn("service worker registration failed");
// });
navigator.serviceWorker.getRegistrations().then(function(registrations) {
for (let registration of registrations) {
registration.unregister();
}
});
}
}
+2 -1
View File
@@ -2,10 +2,11 @@ import React, { PureComponent } from "react";
import Layout from "../components/Layout";
import ConversionPanel from "../components/ConversionPanel";
import defaultText from "../utils/dummy-json";
import { json2ts } from "json-ts";
import PoweredBy from "../components/PoweredBy";
export default class Json2Ts extends PureComponent {
getTransformedValue = code => window.json2ts(code, { flow: true });
getTransformedValue = code => json2ts(code, { flow: true, prefix: "" });
render() {
return (
+5 -1
View File
@@ -2,10 +2,14 @@ import React, { PureComponent } from "react";
import Layout from "../components/Layout";
import ConversionPanel from "../components/ConversionPanel";
import defaultText from "../utils/dummy-json";
import { json2ts } from "json-ts";
import PoweredBy from "../components/PoweredBy";
export default class Json2Ts extends PureComponent {
getTransformedValue = code => window.json2ts(code);
getTransformedValue = code =>
json2ts(code, {
prefix: ""
});
render() {
return (