Compare commits

...

20 Commits

Author SHA1 Message Date
00ab4d3610 1.0.13 2019-04-30 11:23:00 +02:00
0adb181bbf fix(core): update 2019-04-30 11:22:59 +02:00
053ef1f770 1.0.12 2019-04-30 10:55:43 +02:00
d35f32d68f fix(core): update 2019-04-30 10:55:43 +02:00
fb6207d963 1.0.11 2019-04-30 10:54:03 +02:00
e6c2288c24 fix(core): update 2019-04-30 10:54:03 +02:00
b925fffc58 1.0.10 2019-04-30 10:39:54 +02:00
5289d2af92 fix(core): update 2019-04-30 10:39:54 +02:00
b7d1321f3f 1.0.9 2019-04-30 10:28:00 +02:00
3d32d703bf fix(core): update 2019-04-30 10:28:00 +02:00
f2c02e6afc 1.0.8 2019-04-30 10:01:23 +02:00
1a4ff7811c fix(core): update 2019-04-30 10:01:23 +02:00
93431fc2e1 1.0.7 2019-04-30 09:44:47 +02:00
1c039592ce fix(core): update 2019-04-30 09:44:46 +02:00
cb575d2427 1.0.6 2019-04-30 08:42:55 +02:00
d6ad2797cb fix(core): update 2019-04-30 08:42:55 +02:00
7256e3d0e3 1.0.5 2019-04-30 08:35:01 +02:00
fee9b56568 fix(core): update 2019-04-30 08:35:00 +02:00
14a273e5c4 1.0.4 2019-04-29 22:29:56 +02:00
453c72b87e fix(core): update 2019-04-29 22:29:56 +02:00
6 changed files with 66 additions and 22 deletions

3
.gitignore vendored
View File

@ -16,4 +16,5 @@ dist_web/
dist_serve/ dist_serve/
dist_ts_web/ dist_ts_web/
# custom # custom
.rpt2_cache

10
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@gitzone/tsbundle", "name": "@gitzone/tsbundle",
"version": "1.0.3", "version": "1.0.13",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -2337,6 +2337,14 @@
"rollup-pluginutils": "^2.6.0" "rollup-pluginutils": "^2.6.0"
} }
}, },
"rollup-plugin-json": {
"version": "4.0.0",
"resolved": "https://verdaccio.lossless.one/rollup-plugin-json/-/rollup-plugin-json-4.0.0.tgz",
"integrity": "sha512-hgb8N7Cgfw5SZAkb3jf0QXii6QX/FOkiIq2M7BAQIEydjHvTyxXHQiIzZaTFgx1GK0cRCHOCBHIyEkkLdWKxow==",
"requires": {
"rollup-pluginutils": "^2.5.0"
}
},
"rollup-plugin-node-resolve": { "rollup-plugin-node-resolve": {
"version": "4.2.3", "version": "4.2.3",
"resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.2.3.tgz", "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.2.3.tgz",

View File

@ -1,6 +1,6 @@
{ {
"name": "@gitzone/tsbundle", "name": "@gitzone/tsbundle",
"version": "1.0.3", "version": "1.0.13",
"private": false, "private": false,
"description": "a bundler using rollup for painless bundling of web projects", "description": "a bundler using rollup for painless bundling of web projects",
"main": "dist/index.js", "main": "dist/index.js",
@ -8,7 +8,7 @@
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/) && rollup -c rollup.config.js",
"build": "(tsbuild)", "build": "(tsbuild)",
"format": "(gitzone format)" "format": "(gitzone format)"
}, },
@ -27,6 +27,7 @@
"rollup": "^1.10.1", "rollup": "^1.10.1",
"rollup-plugin-babel": "^4.3.2", "rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4", "rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^4.2.3", "rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-typescript2": "^0.20.1" "rollup-plugin-typescript2": "^0.20.1"

View File

@ -18,6 +18,15 @@ a bundler using rollup for painless bundling of web projects
## Usage ## Usage
Use TypeScript for best in class intellisense.
tsbundle will bundle modern JavaScript websites in an Google Bot conformant way so things like AdSense do work.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://gitzone.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)
For further information read the linked docs at the top of this readme. For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)

View File

@ -1,31 +1,49 @@
import resolve from 'rollup-plugin-node-resolve' import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs' import commonjs from 'rollup-plugin-commonjs';
import sourceMaps from 'rollup-plugin-sourcemaps' import sourceMaps from 'rollup-plugin-sourcemaps';
import camelCase from 'lodash.camelcase' import typescript from 'rollup-plugin-typescript2';
import typescript from 'rollup-plugin-typescript2' import json from 'rollup-plugin-json';
import json from 'rollup-plugin-json' import babel from 'rollup-plugin-babel';
import nodeResolve from 'rollup-plugin-node-resolve';
const pkg = require('./package.json') const pkg = require('./package.json');
export default { export default {
input: `src/index.ts`, input: `ts_web/index.ts`,
output: { output: {
file: 'ts/index.ts', name: 'tsbundle',
format: 'es', // file: 'dist_web/bundle.js',
sourcemap: true file: 'dist_web/bundle.js',
}, format: 'iife',
sourcemap: true
},
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash') // Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: [], external: [],
watch: { watch: {
include: 'src/**', include: 'src/**'
}, },
plugins: [ plugins: [
// Allow json resolution // Allow json resolution
json(), json(),
// Compile TypeScript files // Compile TypeScript files
typescript({ useTsconfigDeclarationDir: true }), typescript({ useTsconfigDeclarationDir: true, tsconfigOverride: {
compilerOptions: {
declaration: true,
emitDecoratorMetadata: true,
experimentalDecorators: true,
inlineSourceMap: true,
noEmitOnError: true,
lib: ['es2016', 'es2017', 'dom'],
noImplicitAny: false
}
} }),
nodeResolve(),
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs) // Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs(), commonjs({
namedExports: {
'node_modules/@pushrocks/smartstate/dist/index.js': ['Smartstate']
}
}),
// Allow node_modules resolution, so you can use 'external' to control // Allow node_modules resolution, so you can use 'external' to control
// which external modules to include in the bundle // which external modules to include in the bundle
// https://github.com/rollup/rollup-plugin-node-resolve#usage // https://github.com/rollup/rollup-plugin-node-resolve#usage
@ -33,6 +51,10 @@ export default {
// Resolve source maps to the original source // Resolve source maps to the original source
sourceMaps(), sourceMaps(),
babel() babel({
], extensions: ['.js', '.jsx', '.ts', '.tsx'],
} babelrc: false,
presets: [["@babel/es2015", { modules: false }]]
})
]
};

3
ts_web/index.ts Normal file
View File

@ -0,0 +1,3 @@
const myConst = 'hello';
console.log(myConst);