From e89b9bca8150b0d376ea0de15f0267e851433be3 Mon Sep 17 00:00:00 2001 From: Jimmy Jia Date: Thu, 25 Jun 2015 14:05:41 -0400 Subject: [PATCH] [removed] Don't need to disable Babel cache --- docs/build.js | 5 ++--- tools/build-cli.js | 6 ------ tools/build.js | 11 +++++------ tools/dist/build.js | 8 +++----- webpack/base.config.js | 21 +-------------------- 5 files changed, 11 insertions(+), 40 deletions(-) diff --git a/docs/build.js b/docs/build.js index 0bf9095c42..1ad8005952 100644 --- a/docs/build.js +++ b/docs/build.js @@ -34,10 +34,9 @@ function generateHTML(fileName) { }); } -export default function BuildDocs({useCache, dev}) { +export default function BuildDocs({dev}) { console.log('Building: '.cyan + 'docs'.green + (dev ? ' [DEV]'.grey : '')); - const useCacheOption = `--use-cache=${Boolean(useCache)}`; const devOption = dev ? '' : '-p'; return exec(`rimraf ${docsBuilt}`) @@ -46,7 +45,7 @@ export default function BuildDocs({useCache, dev}) { let pagesGenerators = Root.getPages().map(generateHTML); return Promise.all(pagesGenerators.concat([ - exec(`webpack --config webpack.docs.js ${useCacheOption} --bail ${devOption}`), + exec(`webpack --config webpack.docs.js --bail ${devOption}`), copy(license, docsBuilt), copy(readmeSrc, readmeDest) ])); diff --git a/tools/build-cli.js b/tools/build-cli.js index c9f7c239dd..d3b69fed77 100644 --- a/tools/build-cli.js +++ b/tools/build-cli.js @@ -14,12 +14,6 @@ const argv = yargs demand: false, default: false }) - .option('use-cache', { - type: 'boolean', - demand: false, - default: true, - describe: 'Use Babel cache when running webpack' - }) .option('lib-only', { demand: false, default: false, diff --git a/tools/build.js b/tools/build.js index ee3a1bdbce..401b123a75 100644 --- a/tools/build.js +++ b/tools/build.js @@ -6,22 +6,21 @@ import { copy } from './fs-utils'; import { distRoot, bowerRoot } from './constants'; import { exec } from './exec'; -function forkAndBuildDocs({verbose, useCache}) { +function forkAndBuildDocs({verbose}) { console.log('Building: '.cyan + 'docs'.green); const verboseOption = verbose ? '--verbose' : ''; - const useCacheOption = `--use-cache=${Boolean(useCache)}`; - return exec(`npm run docs-build -- ${verboseOption} ${useCacheOption}`) + return exec(`npm run docs-build -- ${verboseOption}`) .then(() => console.log('Built: '.cyan + 'docs'.green)); } -export default function Build({verbose, useCache} = {}) { +export default function Build(options) { return Promise.all([ lib(), bower(), - dist({useCache}), - forkAndBuildDocs({verbose, useCache}) + dist(), + forkAndBuildDocs(options) ]) .then(() => copy(distRoot, bowerRoot)); } diff --git a/tools/dist/build.js b/tools/dist/build.js index c47704fd27..624327e7a8 100644 --- a/tools/dist/build.js +++ b/tools/dist/build.js @@ -1,15 +1,13 @@ import { exec } from '../exec'; import { distRoot } from '../constants'; -export default function BuildDistributable({useCache}) { +export default function BuildDistributable() { console.log('Building: '.cyan + 'distributable'.green); - const useCacheOption = `--use-cache=${Boolean(useCache)}`; - return exec(`rimraf ${distRoot}`) .then(() => Promise.all([ - exec(`webpack ${useCacheOption} --bail`), - exec(`webpack ${useCacheOption} --bail -p`) + exec(`webpack --bail`), + exec(`webpack --bail -p`) ])) .then(() => console.log('Built: '.cyan + 'distributable'.green)); } diff --git a/webpack/base.config.js b/webpack/base.config.js index 902ff6174f..4a6010214e 100644 --- a/webpack/base.config.js +++ b/webpack/base.config.js @@ -6,32 +6,13 @@ import yargs from 'yargs'; export const options = yargs .alias('p', 'optimize-minimize') .alias('d', 'debug') - .option('use-cache', { - type: 'boolean', - default: true - }) .option('port', { default: '8080', type: 'string' }) .argv; -export let jsLoader = 'babel'; -if (options.useCache) { - const babelCache = path.resolve(path.join(__dirname, '../.babel-cache')); - - if (!fs.existsSync(babelCache)) { - try { - fs.mkdirSync(babelCache); - } catch (err) { - if (err.code !== 'EEXIST') { - console.error(err.stack); - } - } - } - - jsLoader += `?cacheDirectory=${babelCache}`; -} +export const jsLoader = 'babel?cacheDirectory'; const baseConfig = { entry: undefined,