Skip to content

Commit

Permalink
fix(compile): Again bundle all deps into one package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostap Chervak committed Oct 30, 2017
1 parent 87a31a1 commit c630c3a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 46 deletions.
27 changes: 6 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@
}
},
"collectCoverage": true,
"mapCoverage": true,
"globals": {
"ts-jest": {
"tsConfigFile": "tsconfig.test.json"
}
}
"mapCoverage": true
},
"devDependencies": {
"@types/jest": "^21.1.0",
Expand Down Expand Up @@ -101,28 +96,18 @@
"typedoc": "^0.9.0",
"typescript": "^2.3.4",
"uglify-es": "^3.1.5",
"validate-commit-msg": "^2.12.2",
"validate-commit-msg": "^2.12.2"
},
"dependencies": {
"@types/react": "^16.0.9",
"@types/react-dom": "^16.0.0",
"@types/i18next": "^8.4.2",
"@types/react-router-dom": "^4.0.8"
},
"peerDependencies": {
"i18next": "10.x",
"js-logger": "1.x",
"react": "16.x",
"react-dom": "16.x",
"mobx": "3.x",
"mobx-react": "4.x",
"react-router-dom": "4.x",
"satcheljs": "3.x"
},
"dependencies": {
"@types/react-router-dom": "^4.0.8",
"i18next": "^10.0.3",
"js-logger": "^1.4.1",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"mobx": "^3.3.1",
"mobx": "^2.7.0",
"mobx-react": "^4.3.3",
"react-router-dom": "^4.2.2",
"satcheljs": "^3.1.0"
Expand Down
11 changes: 9 additions & 2 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ export default {
output: [{ file: pkg.main, format: 'es' }],
sourcemap: true,
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: Object.keys(pkg.dependencies),
external: ['react', 'react-dom'],
watch: {
include: 'compiled/**'
},
plugins: [
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs(),
commonjs({
namedExports: {
// left-hand side can be an absolute path, a path
// relative to the current directory, or the name
// of a module in node_modules
'js-logger': ['Logger']
}
}),
// Allow node_modules resolution, so you can use 'external' to control
// which external modules to include in the bundle
// https://github.com/rollup/rollup-plugin-node-resolve#usage
Expand Down
2 changes: 1 addition & 1 deletion src/logger-lib/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Logger from 'js-logger';
import Logger from 'js-logger';
import { ILogger } from '../types/logger';

Logger.useDefaults();
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
"compilerOptions": {
"moduleResolution": "node",
"target": "es5",
"module": "esnext",
"module": "es2015",
"lib": ["es2015", "es2016", "es2017", "dom"],
"strict": true,
"sourceMap": true,
"declaration": true,
"allowSyntheticDefaultImports": true,
"jsx": "react",
"noEmitHelpers": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": false,
"declarationDir": "dist/types",
Expand Down
20 changes: 0 additions & 20 deletions tsconfig.test.json

This file was deleted.

0 comments on commit c630c3a

Please sign in to comment.