Compare commits
No commits in common. "7548ddcbc51d52a4eaffe88d1076aa58f8f00fd9" and "d7a42d03f73f4f373bf025140db9c651770ab97a" have entirely different histories.
7548ddcbc5
...
d7a42d03f7
10
.babelrc
10
.babelrc
|
@ -2,14 +2,20 @@
|
||||||
"presets": [
|
"presets": [
|
||||||
["babel-preset-env", {
|
["babel-preset-env", {
|
||||||
"targets": {
|
"targets": {
|
||||||
"node": true,
|
"browsers": [
|
||||||
|
"> 1%",
|
||||||
|
"last 4 versions",
|
||||||
|
"Firefox ESR",
|
||||||
|
"ios >= 8"
|
||||||
|
],
|
||||||
"uglify": false
|
"uglify": false
|
||||||
},
|
},
|
||||||
"spec": true,
|
"spec": true,
|
||||||
"debug": false
|
"debug": true
|
||||||
}]
|
}]
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
"babel-plugin-transform-react-constant-elements",
|
||||||
"babel-plugin-transform-class-properties",
|
"babel-plugin-transform-class-properties",
|
||||||
"babel-plugin-syntax-dynamic-import"
|
"babel-plugin-syntax-dynamic-import"
|
||||||
]
|
]
|
||||||
|
|
|
@ -22,15 +22,11 @@ build/Release
|
||||||
# Dependency directory
|
# Dependency directory
|
||||||
# Deployed apps should consider commenting this line out:
|
# Deployed apps should consider commenting this line out:
|
||||||
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
|
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
|
||||||
node_modules/**
|
node_modules
|
||||||
!node_modules/.gitkeep
|
|
||||||
|
|
||||||
# Webpack output
|
# Webpack output
|
||||||
/dist
|
/dist
|
||||||
|
|
||||||
# Intermediate build files (cache, etc.)
|
|
||||||
/build
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
Dockerfile
|
Dockerfile
|
||||||
|
|
|
@ -22,11 +22,7 @@ build/Release
|
||||||
# Dependency directory
|
# Dependency directory
|
||||||
# Deployed apps should consider commenting this line out:
|
# Deployed apps should consider commenting this line out:
|
||||||
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
|
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
|
||||||
node_modules/**
|
node_modules
|
||||||
!node_modules/.gitkeep
|
|
||||||
|
|
||||||
# Webpack output
|
# Webpack output
|
||||||
/dist
|
/dist
|
||||||
|
|
||||||
# Intermediate build files (cache, etc.)
|
|
||||||
/build
|
|
||||||
|
|
|
@ -20,13 +20,10 @@ coverage
|
||||||
build/Release
|
build/Release
|
||||||
|
|
||||||
# Dependency directory
|
# Dependency directory
|
||||||
# Deployed apps should consider commenting this line out:
|
# Deployed apps should consider commenting these line out:
|
||||||
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
|
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
|
||||||
node_modules/**
|
node_modules/**
|
||||||
!node_modules/.gitkeep
|
!node_modules/.gitkeep
|
||||||
|
|
||||||
# Webpack output
|
# Webpack output
|
||||||
/dist
|
/dist
|
||||||
|
|
||||||
# Intermediate build files (cache, etc.)
|
|
||||||
/build
|
|
||||||
|
|
|
@ -10416,12 +10416,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"preact": {
|
|
||||||
"version": "8.2.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/preact/-/preact-8.2.4.tgz",
|
|
||||||
"integrity": "sha1-FE6lDLV7dlmsX2MRkblBi97H7Qo=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"preact-compat": {
|
"preact-compat": {
|
||||||
"version": "3.17.0",
|
"version": "3.17.0",
|
||||||
"resolved": "https://registry.npmjs.org/preact-compat/-/preact-compat-3.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/preact-compat/-/preact-compat-3.17.0.tgz",
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"build": "webpack",
|
"build": "webpack",
|
||||||
"build:production": "npm run -s build -- --env production",
|
"build:production": "npm run -s build -- --env production",
|
||||||
"build:development": "npm run -s build -- --env development",
|
"build:development": "npm run -s build -- --env development",
|
||||||
"clean": "rimraf build dist",
|
"clean": "nwb clean-app",
|
||||||
"docker-compose": "docker-compose -f docker-compose.local.yml",
|
"docker-compose": "docker-compose -f docker-compose.local.yml",
|
||||||
"docker:down:clean": "npm run -s docker:down -- --rmi all -v",
|
"docker:down:clean": "npm run -s docker:down -- --rmi all -v",
|
||||||
"docker:down": "npm run -s docker-compose -- down",
|
"docker:down": "npm run -s docker-compose -- down",
|
||||||
|
@ -80,7 +80,6 @@
|
||||||
"react-hot-loader": "^3.0.0-beta.7",
|
"react-hot-loader": "^3.0.0-beta.7",
|
||||||
"react-router": "^4.2.0",
|
"react-router": "^4.2.0",
|
||||||
"resolve-url-loader": "^2.1.0",
|
"resolve-url-loader": "^2.1.0",
|
||||||
"rimraf": "^2.6.1",
|
|
||||||
"sass-loader": "^6.0.6",
|
"sass-loader": "^6.0.6",
|
||||||
"slash": "^1.0.0",
|
"slash": "^1.0.0",
|
||||||
"style-loader": "^0.18.2",
|
"style-loader": "^0.18.2",
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
["babel-preset-env", {
|
||||||
|
"targets": {
|
||||||
|
"browsers": [
|
||||||
|
"> 1%",
|
||||||
|
"last 4 versions",
|
||||||
|
"Firefox ESR",
|
||||||
|
"ios >= 8"
|
||||||
|
],
|
||||||
|
"uglify": false
|
||||||
|
},
|
||||||
|
/*"spec": true,*/
|
||||||
|
"debug": true,
|
||||||
|
"modules": false
|
||||||
|
}],
|
||||||
|
"babel-preset-react"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"react-hot-loader/babel",
|
||||||
|
"babel-plugin-transform-react-constant-elements",
|
||||||
|
/*"babel-plugin-transform-react-remove-prop-types",*/
|
||||||
|
/*"babel-plugin-transform-decorators-legacy",*/
|
||||||
|
"babel-plugin-transform-class-properties",
|
||||||
|
["babel-plugin-transform-runtime", {
|
||||||
|
"helpers": false,
|
||||||
|
"polyfill": false,
|
||||||
|
"regenerator": true
|
||||||
|
}],
|
||||||
|
"babel-plugin-syntax-dynamic-import"
|
||||||
|
]
|
||||||
|
}
|
15
src/App.jsx
15
src/App.jsx
|
@ -45,7 +45,6 @@ class App extends React.Component {
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
clearInterval(this.interval);
|
clearInterval(this.interval);
|
||||||
this.interval = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
calculateUpcomingDate() {
|
calculateUpcomingDate() {
|
||||||
|
@ -57,19 +56,7 @@ class App extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUpcomingDate() {
|
updateUpcomingDate() {
|
||||||
const { getNow } = this.props;
|
this.setState({ nextUpcomingDate: this.calculateUpcomingDate() });
|
||||||
|
|
||||||
const nextUpcomingDate = this.calculateUpcomingDate();
|
|
||||||
|
|
||||||
if (this.interval) {
|
|
||||||
const interval = moment.duration(nextUpcomingDate.diff(getNow()))
|
|
||||||
.asMilliseconds();
|
|
||||||
|
|
||||||
clearInterval(this.interval);
|
|
||||||
this.interval = setInterval(this.updateUpcomingDate.bind(this), interval);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setState({ nextUpcomingDate });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -28,13 +28,6 @@ const {
|
||||||
|
|
||||||
const locales = ['en'];
|
const locales = ['en'];
|
||||||
|
|
||||||
const autoprefixerTargets = [
|
|
||||||
'> 1%',
|
|
||||||
'last 4 versions',
|
|
||||||
'Firefox ESR',
|
|
||||||
'ios >= 8',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin for HtmlPlugin which inlines content for an extracted Webpack manifest
|
* Plugin for HtmlPlugin which inlines content for an extracted Webpack manifest
|
||||||
* into the HTML in a <script> tag before other emitted asssets are injected by
|
* into the HTML in a <script> tag before other emitted asssets are injected by
|
||||||
|
@ -160,7 +153,7 @@ export default (options) => {
|
||||||
ident: 'postcss',
|
ident: 'postcss',
|
||||||
plugins: [
|
plugins: [
|
||||||
autoprefixer({
|
autoprefixer({
|
||||||
browsers: autoprefixerTargets,
|
browsers: '> 1%, last 4 versions, Firefox ESR, ios >= 8',
|
||||||
grid: false,
|
grid: false,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
@ -197,7 +190,7 @@ export default (options) => {
|
||||||
return cssLoaders;
|
return cssLoaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = {
|
return {
|
||||||
devServer: {
|
devServer: {
|
||||||
// inline: true,
|
// inline: true,
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -208,7 +201,7 @@ export default (options) => {
|
||||||
noInfo: true,
|
noInfo: true,
|
||||||
overlay: true,
|
overlay: true,
|
||||||
publicPath: '',
|
publicPath: '',
|
||||||
quiet: false,
|
quiet: true,
|
||||||
watchOptions: {
|
watchOptions: {
|
||||||
ignored: /node_modules/,
|
ignored: /node_modules/,
|
||||||
},
|
},
|
||||||
|
@ -221,34 +214,11 @@ export default (options) => {
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
options: {
|
options: {
|
||||||
// Look for babel configuration in project directory
|
// Look for babel configuration in project directory
|
||||||
babelrc: false,
|
babelrc: true,
|
||||||
// Cache transformations to the filesystem (in default temp dir)
|
// Cache transformations to the filesystem (in default temp dir)
|
||||||
cacheDirectory: true,
|
cacheDirectory: true,
|
||||||
|
// Skip module transpiling as Webpack 2+ support it ootb
|
||||||
forceEnv: 'browser',
|
forceEnv: 'browser',
|
||||||
|
|
||||||
presets: [
|
|
||||||
['babel-preset-env', {
|
|
||||||
targets: {
|
|
||||||
browsers: autoprefixerTargets,
|
|
||||||
uglify: false,
|
|
||||||
},
|
|
||||||
// spec: true,
|
|
||||||
debug: development,
|
|
||||||
modules: false, // do not transpile modules, webpack 2+ does that
|
|
||||||
}],
|
|
||||||
'babel-preset-react',
|
|
||||||
],
|
|
||||||
plugins: [
|
|
||||||
'babel-plugin-transform-react-constant-elements',
|
|
||||||
'babel-plugin-transform-class-properties',
|
|
||||||
['babel-plugin-transform-runtime', {
|
|
||||||
helpers: false,
|
|
||||||
polyfill: false,
|
|
||||||
regenerator: true,
|
|
||||||
}],
|
|
||||||
'babel-plugin-syntax-dynamic-import',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
...[
|
...[
|
||||||
|
@ -377,7 +347,7 @@ export default (options) => {
|
||||||
showErrors: true,
|
showErrors: true,
|
||||||
chunks: 'all',
|
chunks: 'all',
|
||||||
excludeChunks: [],
|
excludeChunks: [],
|
||||||
title: 'VIzon Countdown',
|
title: 'Webpack App',
|
||||||
xhtml: false,
|
xhtml: false,
|
||||||
chunksSortMode: 'dependency',
|
chunksSortMode: 'dependency',
|
||||||
}),
|
}),
|
||||||
|
@ -390,6 +360,11 @@ export default (options) => {
|
||||||
'.js', '.json', '.jsx',
|
'.js', '.json', '.jsx',
|
||||||
],
|
],
|
||||||
alias: {
|
alias: {
|
||||||
|
// Use preact instead of react
|
||||||
|
/* react: 'preact-compat\\dist\\preact-compat',
|
||||||
|
'react-dom': 'preact-compat\\dist\\preact-compat',
|
||||||
|
'create-react-class': 'preact-compat/lib/create-react-class', */
|
||||||
|
|
||||||
'moment-timezone': 'moment-timezone/builds/moment-timezone-with-data-2012-2022.js',
|
'moment-timezone': 'moment-timezone/builds/moment-timezone-with-data-2012-2022.js',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -408,15 +383,4 @@ export default (options) => {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!server) {
|
|
||||||
// Use preact instead of react (only on static build)
|
|
||||||
Object.assign(config.resolve.alias, {
|
|
||||||
react: !server ? 'preact-compat\\dist\\preact-compat' : undefined,
|
|
||||||
'react-dom': !server ? 'preact-compat\\dist\\preact-compat' : undefined,
|
|
||||||
'create-react-class': !server ? 'preact-compat/lib/create-react-class' : undefined,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return config;
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue