-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c5eade
commit b89d539
Showing
825 changed files
with
603 additions
and
2,171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// https://github.com/michael-ciniawsky/postcss-load-config | ||
|
||
module.exports = { | ||
"plugins": { | ||
plugins: { | ||
// to edit target browsers: use "browserslist" field in package.json | ||
"autoprefixer": {} | ||
autoprefixer: {} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,45 @@ | ||
'use strict' | ||
require('./check-versions')() | ||
"use strict"; | ||
require("./check-versions")(); | ||
|
||
process.env.NODE_ENV = 'production' | ||
process.env.NODE_ENV = "production"; | ||
|
||
const ora = require('ora') | ||
const rm = require('rimraf') | ||
const path = require('path') | ||
const chalk = require('chalk') | ||
const webpack = require('webpack') | ||
const config = require('../config') | ||
const webpackConfig = require('./webpack.prod.conf') | ||
const ora = require("ora"); | ||
const rm = require("rimraf"); | ||
const path = require("path"); | ||
const chalk = require("chalk"); | ||
const webpack = require("webpack"); | ||
const config = require("../config"); | ||
const webpackConfig = require("./webpack.prod.conf"); | ||
|
||
const spinner = ora('building for production...') | ||
spinner.start() | ||
const spinner = ora("building for production..."); | ||
spinner.start(); | ||
|
||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { | ||
if (err) throw err | ||
webpack(webpackConfig, function (err, stats) { | ||
spinner.stop() | ||
if (err) throw err | ||
process.stdout.write(stats.toString({ | ||
colors: true, | ||
modules: false, | ||
children: false, | ||
chunks: false, | ||
chunkModules: false | ||
}) + '\n\n') | ||
if (err) throw err; | ||
webpack(webpackConfig, function(err, stats) { | ||
spinner.stop(); | ||
if (err) throw err; | ||
process.stdout.write( | ||
stats.toString({ | ||
colors: true, | ||
modules: false, | ||
children: false, | ||
chunks: false, | ||
chunkModules: false | ||
}) + "\n\n" | ||
); | ||
|
||
if (stats.hasErrors()) { | ||
console.log(chalk.red(' Build failed with errors.\n')) | ||
process.exit(1) | ||
console.log(chalk.red(" Build failed with errors.\n")); | ||
process.exit(1); | ||
} | ||
|
||
console.log(chalk.cyan(' Build complete.\n')) | ||
console.log(chalk.yellow( | ||
' Tip: built files are meant to be served over an HTTP server.\n' + | ||
' Opening index.html over file:// won\'t work.\n' | ||
)) | ||
}) | ||
}) | ||
console.log(chalk.cyan(" Build complete.\n")); | ||
console.log( | ||
chalk.yellow( | ||
" Tip: built files are meant to be served over an HTTP server.\n" + | ||
" Opening index.html over file:// won't work.\n" | ||
) | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,59 @@ | ||
'use strict' | ||
const chalk = require('chalk') | ||
const semver = require('semver') | ||
const packageConfig = require('../package.json') | ||
const shell = require('shelljs') | ||
function exec (cmd) { | ||
return require('child_process').execSync(cmd).toString().trim() | ||
"use strict"; | ||
const chalk = require("chalk"); | ||
const semver = require("semver"); | ||
const packageConfig = require("../package.json"); | ||
const shell = require("shelljs"); | ||
function exec(cmd) { | ||
return require("child_process") | ||
.execSync(cmd) | ||
.toString() | ||
.trim(); | ||
} | ||
|
||
const versionRequirements = [ | ||
{ | ||
name: 'node', | ||
name: "node", | ||
currentVersion: semver.clean(process.version), | ||
versionRequirement: packageConfig.engines.node | ||
} | ||
] | ||
]; | ||
|
||
if (shell.which('npm')) { | ||
if (shell.which("npm")) { | ||
versionRequirements.push({ | ||
name: 'npm', | ||
currentVersion: exec('npm --version'), | ||
name: "npm", | ||
currentVersion: exec("npm --version"), | ||
versionRequirement: packageConfig.engines.npm | ||
}) | ||
}); | ||
} | ||
|
||
module.exports = function () { | ||
const warnings = [] | ||
module.exports = function() { | ||
const warnings = []; | ||
for (let i = 0; i < versionRequirements.length; i++) { | ||
const mod = versionRequirements[i] | ||
const mod = versionRequirements[i]; | ||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { | ||
warnings.push(mod.name + ': ' + | ||
chalk.red(mod.currentVersion) + ' should be ' + | ||
chalk.green(mod.versionRequirement) | ||
) | ||
warnings.push( | ||
mod.name + | ||
": " + | ||
chalk.red(mod.currentVersion) + | ||
" should be " + | ||
chalk.green(mod.versionRequirement) | ||
); | ||
} | ||
} | ||
|
||
if (warnings.length) { | ||
console.log('') | ||
console.log(chalk.yellow('To use this template, you must update following to modules:')) | ||
console.log() | ||
console.log(""); | ||
console.log( | ||
chalk.yellow( | ||
"To use this template, you must update following to modules:" | ||
) | ||
); | ||
console.log(); | ||
for (let i = 0; i < warnings.length; i++) { | ||
const warning = warnings[i] | ||
console.log(' ' + warning) | ||
const warning = warnings[i]; | ||
console.log(" " + warning); | ||
} | ||
console.log() | ||
process.exit(1) | ||
console.log(); | ||
process.exit(1); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
/* eslint-disable */ | ||
'use strict' | ||
require('eventsource-polyfill') | ||
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') | ||
"use strict"; | ||
require("eventsource-polyfill"); | ||
var hotClient = require("webpack-hot-middleware/client?noInfo=true&reload=true"); | ||
|
||
hotClient.subscribe(function (event) { | ||
if (event.action === 'reload') { | ||
window.location.reload() | ||
hotClient.subscribe(function(event) { | ||
if (event.action === "reload") { | ||
window.location.reload(); | ||
} | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.