File: rules

package info (click to toggle)
node-rollup-plugin-typescript 6.0.0%2B~1.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,544 kB
  • sloc: javascript: 11,773; makefile: 29
file content (37 lines) | stat: -rwxr-xr-x 1,325 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/make -f
# -*- makefile -*-

ifneq ($(filter pkg.node-rollup-plugin-typescript.transpilebabel,$(DEB_BUILD_PROFILES)),)
TRANSPILE_PROF?=babel7
BABEL_PRESET?=env
export BABEL_PRESET
else ifneq ($(filter pkg.node-rollup-plugin-typescript.transpilebuble,$(DEB_BUILD_PROFILES)),)
TRANSPILE_PROF?=buble
else ifneq ($(filter pkg.node-rollup-plugin-typescript.transpilenone,$(DEB_BUILD_PROFILES)),)
TRANSPILE_PROF?=none
else
TRANSPILE_PROF?=none
endif
TRANSPILE?=$(TRANSPILE_PROF)
export TRANSPILE


%:
	dh $@

override_dh_auto_build:
	dh_auto_build --buildsystem=nodejs
	# Step 1: build a temporary @rollup/plugin-typescript
	cd packages/typescript && \
		ln -s ../../../node_modules/@types/resolve node_modules/ && \
		mkdir dist && \
		NODE_PATH=node_modules tsc --module CommonJS --esModuleInterop src/index.ts
	cd packages/typescript/src && \
		tar cf - `find . -name '*.js' -type f` |(cd ../dist; tar xf -) && \
		find . -name '*.js' -type f -delete
	mkdir -p packages/typescript/node_modules/@rollup
	mv packages/typescript/dist packages/typescript/node_modules/@rollup/plugin-typescript
	cp packages/typescript/package.json packages/typescript/node_modules/@rollup/plugin-typescript/
	# Step 2: upstream build
	cd packages/typescript && rollup -c
	rm -rf packages/typescript/node_modules/@rollup/plugin-typescript/