Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
fb6207d963 | |||
e6c2288c24 | |||
b925fffc58 | |||
5289d2af92 | |||
b7d1321f3f | |||
3d32d703bf | |||
f2c02e6afc | |||
1a4ff7811c | |||
93431fc2e1 | |||
1c039592ce |
3
.gitignore
vendored
3
.gitignore
vendored
@ -16,4 +16,5 @@ dist_web/
|
||||
dist_serve/
|
||||
dist_ts_web/
|
||||
|
||||
# custom
|
||||
# custom
|
||||
.rpt2_cache
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tsbundle",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.11",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tsbundle",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.11",
|
||||
"private": false,
|
||||
"description": "a bundler using rollup for painless bundling of web projects",
|
||||
"main": "dist/index.js",
|
||||
@ -8,7 +8,7 @@
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"test": "(tstest test/) && rollup -c rollup.config.js",
|
||||
"build": "(tsbuild)",
|
||||
"format": "(gitzone format)"
|
||||
},
|
||||
|
@ -17,10 +17,18 @@ a bundler using rollup for painless bundling of web projects
|
||||
[](https://prettier.io/)
|
||||
|
||||
## 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)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
|
@ -1,30 +1,47 @@
|
||||
import resolve from 'rollup-plugin-node-resolve'
|
||||
import commonjs from 'rollup-plugin-commonjs'
|
||||
import sourceMaps from 'rollup-plugin-sourcemaps'
|
||||
import typescript from 'rollup-plugin-typescript2'
|
||||
import json from 'rollup-plugin-json'
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import sourceMaps from 'rollup-plugin-sourcemaps';
|
||||
import typescript from 'rollup-plugin-typescript2';
|
||||
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 {
|
||||
input: `ts_web/index.ts`,
|
||||
output: {
|
||||
file: 'dist/bundle.js',
|
||||
file: 'dist/bundle.js',
|
||||
format: 'es',
|
||||
sourcemap: true
|
||||
},
|
||||
sourcemap: true
|
||||
},
|
||||
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
|
||||
external: [],
|
||||
watch: {
|
||||
include: 'src/**',
|
||||
include: 'src/**'
|
||||
},
|
||||
plugins: [
|
||||
// Allow json resolution
|
||||
json(),
|
||||
// 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)
|
||||
commonjs(),
|
||||
commonjs({
|
||||
namedExports: {
|
||||
'node_modules/@pushrocks/smartstate/dist/index.js': ['Smartstate']
|
||||
}
|
||||
}),
|
||||
// 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
|
||||
@ -33,5 +50,5 @@ export default {
|
||||
// Resolve source maps to the original source
|
||||
sourceMaps(),
|
||||
babel()
|
||||
],
|
||||
}
|
||||
]
|
||||
};
|
||||
|
3
ts_web/index.ts
Normal file
3
ts_web/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
const myConst = 'hello';
|
||||
|
||||
console.log(myConst);
|
Reference in New Issue
Block a user