Skip to content

Commit

Permalink
fix: browserslist config, build:vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell committed Jun 26, 2019
1 parent 562f26e commit 32acf6b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
"scripts": {
"build:analyze": "webpack --mode production -p --progress --config tools/webpack.config --analyze",
"build:plugins": "webpack --mode production -p --display-entrypoints --progress --config tools/webpack.plugins.config",
"build:vendor": "mkdir -p demo/assets/js/ && babel-node tools/build-vendor",
"build:vendor": "babel-node tools/build-vendor",
"build": "webpack --mode production -p --progress --config tools/webpack.config",
"build:all": "npm-run-all build build:vendor build:plugins copy",
"build:all": "npm-run-all build:plugins build:vendor build copy",
"copy": "cp -a dist/* demo/assets/js/ && cp CONTRIBUTING.md docs/contributing.md && cp LICENSE docs/license.md && mkdir -p demo/assets/lang && cp node_modules/formbuilder-languages/*.lang demo/assets/lang/",
"deploy": "npm run-script build && node tools/deploy.js",
"deploy:site": "npm run-script docs && cd site/ && npm run-script deploy && cd ../",
Expand All @@ -88,7 +88,8 @@
"lint": "eslint ./src --ext .js || true",
"semantic-release": "semantic-release",
"start:devServer": "webpack-dev-server --mode development --open --config tools/webpack.config",
"start": "npm-run-all build:vendor start:devServer",
"prestart": "npm run build:vendor",
"start": "npm run start:devServer",
"test": "npm run-script build",
"travis-deploy-once": "travis-deploy-once"
},
Expand Down Expand Up @@ -123,6 +124,7 @@
"eslint-loader": "^2.1.2",
"eslint-plugin-prettier": "^3.0.1",
"formbuilder-languages": "^0.1.0",
"fs-extra": "^8.0.1",
"html-webpack-harddisk-plugin": "^1.0.1",
"html-webpack-plugin": "^3.2.0",
"inquirer": "^6.3.1",
Expand Down Expand Up @@ -208,5 +210,8 @@
"@semantic-release/npm",
"@semantic-release/git"
]
}
},
"browserslist": [
"> 1%"
]
}
22 changes: 11 additions & 11 deletions tools/build-vendor.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import pkg from '../package.json';
import {resolve} from 'path';
import concat from 'concat-files';
import { ensureDirSync } from 'fs-extra'
import pkg from '../package.json'
import { resolve } from 'path'
import concat from 'concat-files'

const vendor = Object.keys(pkg.dependencies).map(module => require.resolve(module));
const targetDir = resolve(__dirname, '../demo/assets/js')

ensureDirSync(targetDir)
const vendor = Object.keys(pkg.dependencies).map(require.resolve)

/**
* Concatenates the vendor files into a single vendor file for the demo
* @return {Function} concat
*/
async function concatVendorFiles() {
return concat(vendor, resolve(__dirname, '../demo/assets/js/vendor.js'), function(err) {
if (err) throw err;
});
}

export default concatVendorFiles;
concat(vendor, `${targetDir}/vendor.js`, function(err, data) {
if (err) throw err
})
4 changes: 1 addition & 3 deletions tools/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ const webpackConfig = {
loader: 'postcss-loader',
options: {
plugins: [
autoprefixer({
browsers: ['> 1%'],
}),
autoprefixer(),
],
sourceMap: !PRODUCTION,
},
Expand Down

0 comments on commit 32acf6b

Please sign in to comment.