Skip to content

Commit

Permalink
chore(build): improve build & fix IE behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
buchslava committed Feb 21, 2019
1 parent 9840556 commit 3ea023b
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ coverage.lcov
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
lib
lib-web

# Dependency directories
node_modules
Expand Down
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ test/
.gitmodules
node_modules/
webpack.config.js
test/fixtures
test/fixtures
test/static-fixtures
2 changes: 0 additions & 2 deletions dist/babel-polyfill.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/babel-polyfill.js.map

This file was deleted.

17 changes: 17 additions & 0 deletions dist/vizabi-ddfcsv-reader-polyfill.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/vizabi-ddfcsv-reader-polyfill.js.map

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions dist/vizabi-ddfcsv-reader.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vizabi-ddfcsv-reader.js.map

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vizabi-ddfcsv-reader",
"version": "3.0.0",
"version": "3.0.10",
"description": "Vizabi DDFcsv reader",
"author": "Vyacheslav Chub<[email protected]>",
"license": "GPL-3.0",
Expand All @@ -11,11 +11,12 @@
"tslint:src": "./node_modules/.bin/tslint -c ./tslint.json 'src/**/*.ts'",
"tslint:tests": "./node_modules/.bin/tslint -c ./test/tslint.json 'test/**/*.ts'",
"tslint": "npm run tslint:src && npm run tslint:tests",
"tsc": "tsc --project tsconfig.json && npm run set-own-version",
"tsc-node": "tsc --project tsconfig.json && TARGET_DIR=lib npm run set-own-version",
"tsc-web": "tsc --project tsconfig-web.json && TARGET_DIR=lib-web npm run set-own-version",
"submodules:init": "git submodule update --remote --init -f",
"coverage:clean": "rm -rf coverage && rm -rf .nyc_output && rm -rf coverage.lcov",
"remove-unneeded": "rm -rf test/fixtures/systema_globalis/master-HEAD/etl",
"pree2e": "npm run submodules:init && npm run remove-unneeded && npm run coverage:clean && npm run tslint && npm run tsc",
"pree2e": "npm run submodules:init && npm run remove-unneeded && npm run coverage:clean && npm run tslint && npm run tsc-node",
"e2e": "nyc mocha",
"pree2e:doc": "npm run pree2e",
"e2e:doc": "mocha --require ts-node/register -R markdown > API.SPECIFICATION.md --recursive test/*.spec.ts",
Expand All @@ -26,8 +27,8 @@
"changelog": "conventional-changelog -i CHANGELOG.md -s -p angular",
"github-release": "conventional-github-releaser -p angular",
"build": "npm run build:web && rimraf lib && npm run build:node",
"build:node": "npm run tsc",
"build:web": "npm run tsc && npm run webpack",
"build:node": "npm run tsc-node",
"build:web": "npm run tsc-web && npm run webpack",
"preversion": "npm run build",
"version": "npm run changelog && git add CHANGELOG.md",
"postversion": "git push origin master && git push --tags && npm run github-release",
Expand All @@ -54,8 +55,8 @@
"instrument": true
},
"dependencies": {
"cross-project-diagnostics": "0.1.3",
"ddf-query-validator": "1.3.0",
"cross-project-diagnostics": "0.1.5",
"ddf-query-validator": "1.3.4",
"fetch-polyfill": "0.8.2",
"https": "1.0.0",
"lodash.clonedeep": "4.5.0",
Expand Down Expand Up @@ -116,12 +117,12 @@
"source-map-support": "0.5.6",
"ts-loader": "4.3.0",
"ts-node": "7.0.0",
"tslib": "1.9.3",
"tslint": "5.11.0",
"tslint-no-unused-expression-chai": "0.1.3",
"typescript": "3.2.2",
"uglifyjs-webpack-plugin": "1.2.5",
"webpack": "4.8.1",
"webpack-bundle-analyzer": "^3.0.4",
"webpack-cli": "2.1.3",
"webpack-dev-server": "3.1.4",
"webpack-merge": "4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion scripts/set-own-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ try {
process.exit(1);
}

const fileName = path.resolve('..', 'lib', 'src', 'ddfcsv-reader.js');
const fileName = path.resolve('..', process.env.TARGET_DIR, 'src', 'ddfcsv-reader.js');
const content = fs.readFileSync(fileName, 'utf-8');
const oldVersionContent = /const myVersion = '';/;
const newVersionContent = `const myVersion = '${process.env.npm_package_version}';`;
Expand Down
38 changes: 38 additions & 0 deletions tsconfig-web.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"compilerOptions": {
"declaration": true,
"target": "es5",
"module": "commonjs",
"noImplicitAny": false,
"outDir": "./lib-web/src",
"preserveConstEnums": true,
"removeComments": true,
"typeRoots": ["node_modules/@types"],
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"sourceMap": true,
"noEmitHelpers": true,
"importHelpers": true,
"strictNullChecks": false,
"baseUrl": ".",
"lib": [
"es2017",
"dom"
],
"downlevelIteration": true
},
"include": [
"src/index-web.ts"
],
"exclude": [
"dist",
"lib",
"lib-web",
"node_modules",
"**/*.spec.ts",
"test/common.ts"
]
}
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"strictNullChecks": false,
"baseUrl": ".",
"lib": [
"es2017",
"es2018",
"dom"
]
},
"include": [
"src/index.ts",
"src/index-web.ts"
"src/index.ts"
],
"exclude": [
"dist",
"lib",
"lib-web",
"node_modules",
"**/*.spec.ts",
"test/common.ts"
Expand Down
9 changes: 5 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = () => ({
mode: 'production',
entry: {
'babel-polyfill': 'babel-polyfill',
'vizabi-ddfcsv-reader': './lib/src/index-web.js'
'vizabi-ddfcsv-reader': ['./lib-web/src/index-web.js'],
'vizabi-ddfcsv-reader-polyfill': ['babel-polyfill', './lib-web/src/index-web.js']
},
output: {
path: path.join(__dirname, 'dist'),
Expand All @@ -19,7 +20,6 @@ module.exports = () => ({
rules: [
{
test: /\.js$/,
exclude: /node_modules\/(?![ddf\-query\-validator])/,
use: {
loader: "babel-loader",
options: {
Expand All @@ -32,6 +32,7 @@ module.exports = () => ({
]
},
plugins: [
new CleanWebpackPlugin(['dist'])
new CleanWebpackPlugin(['dist'])// ,
// new BundleAnalyzerPlugin()
]
});

0 comments on commit 3ea023b

Please sign in to comment.