Skip to content

Commit ab17812

Browse files
authored
Merge pull request #120 from amplitude/rollup
Replace webpack with rollup
2 parents bef7169 + a5863a2 commit ab17812

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+6613
-10285
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
["env", {
44
"targets": {
55
"browsers": ["ie >= 6"]
6-
}
6+
},
7+
"modules": false
78
}]
89
]
910
}

.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"browserify" : false, // Browserify (node.js code in the browser)
6868
"couch" : false, // CouchDB
6969
"devel" : true, // Development/debugging (alert, confirm, etc)
70+
"esversion" : 6, // Support ES version 6 syntax
7071
"dojo" : false, // Dojo Toolkit
7172
"jasmine" : false, // Jasmine
7273
"jquery" : false, // jQuery
@@ -84,4 +85,4 @@
8485

8586
// Custom Globals
8687
"globals" : {} // additional predefined global variables
87-
}
88+
}

Makefile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ SNIPPET = src/amplitude-snippet.js
33
TESTS = $(wildcard test/*.js)
44
BINS = node_modules/.bin
55
DUO = $(BINS)/duo
6-
WEBPACK = $(BINS)/webpack
76
MINIFY = $(BINS)/uglifyjs
87
JSDOC = $(BINS)/jsdoc
98
JSHINT = $(BINS)/jshint
@@ -14,6 +13,8 @@ SNIPPET_OUT = $(PROJECT)-snippet.min.js
1413
SEGMENT_SNIPPET_OUT = $(PROJECT)-segment-snippet.min.js
1514
MIN_OUT = $(PROJECT).min.js
1615
MOCHA = $(BINS)/mocha-phantomjs
16+
KARMA = $(BINS)/karma
17+
ROLLUP = $(BINS)/rollup
1718

1819
#
1920
# Default target.
@@ -35,10 +36,10 @@ clean:
3536
#
3637

3738
test: build
38-
@./node_modules/.bin/karma start karma.conf.js
39+
@$(KARMA) start karma.conf.js
3940

4041
test-sauce: build
41-
@./node_modules/.bin/karma start karma.conf.js --browsers sauce_chrome_windows
42+
@$(KARMA) start karma.conf.js --browsers sauce_chrome_windows
4243

4344

4445
#
@@ -52,6 +53,7 @@ node_modules: package.json
5253
# Target for updating version.
5354

5455
version: package.json src/version.js
56+
@$(ROLLUP) src/version.js -o build/version.js -f cjs
5557
node scripts/version
5658

5759
#
@@ -64,10 +66,10 @@ README.md: $(SNIPPET_OUT) version
6466
# Target for `amplitude.js` file.
6567
#
6668

67-
$(OUT): node_modules $(SRC) version
69+
$(OUT): node_modules $(SRC) version rollup.config.js rollup.min.js
6870
@$(JSHINT) --verbose $(SRC)
69-
@$(WEBPACK) --config webpack.build.js
70-
@NODE_ENV=production $(WEBPACK) --config webpack.build.js
71+
@NODE_ENV=production $(ROLLUP) --config rollup.config.js
72+
@NODE_ENV=production $(ROLLUP) --config rollup.min.js
7173

7274
#
7375
# Target for minified `amplitude-snippet.js` file.
@@ -85,7 +87,7 @@ $(SEGMENT_SNIPPET_OUT): $(SRC) $(SNIPPET) version
8587
#
8688

8789
build: $(TESTS) $(OUT) $(SNIPPET_OUT) $(SEGMENT_SNIPPET_OUT) README.md
88-
@$(WEBPACK) --config webpack.test.js
90+
@$(ROLLUP) --config rollup.test.js
8991
@$(DUO) --development test/snippet-tests.js > build/snippet-tests.js
9092

9193
docs:

0 commit comments

Comments
 (0)