From 154cd4326dd1c82ff48b24860b6fc6b2ff4f94da Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sat, 19 Nov 2016 13:10:32 -0500 Subject: [PATCH] set up build --- .gitignore | 1 + package.json | 12 +++++++++--- rollup.config.js | 13 +++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 rollup.config.js diff --git a/.gitignore b/.gitignore index 9daa8247da..8d67a86cda 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store node_modules +dist diff --git a/package.json b/package.json index 4796b7afdb..2d01e1b584 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,14 @@ "name": "svelte", "version": "0.0.1", "description": "The magical disappearing UI framework", - "main": "dist/svelte-compiler.js", + "main": "dist/svelte.umd.js", + "module": "dist/svelte.es.js", "scripts": { "test": "mocha --opts mocha.opts --recursive ./**/__test__.js test/test.js", - "lint": "eslint compiler" + "lint": "eslint compiler", + "build": "rollup -c", + "prebuild": "npm test", + "prepublish": "npm run lint && npm run build" }, "repository": { "type": "git", @@ -28,7 +32,9 @@ "eslint-plugin-import": "^2.2.0", "jsdom": "^9.8.3", "mocha": "^3.1.2", - "reify": "^0.4.0" + "node-resolve": "^1.3.3", + "reify": "^0.4.0", + "rollup-plugin-node-resolve": "^2.0.0" }, "dependencies": { "acorn": "^4.0.3", diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000000..29aed745e2 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,13 @@ +import nodeResolve from 'rollup-plugin-node-resolve'; + +export default { + entry: 'compiler/index.js', + moduleName: 'svelte', + targets: [ + { dest: 'dist/svelte.umd.js', format: 'umd' }, + { dest: 'dist/svelte.es.js', format: 'es' } + ], + plugins: [ + nodeResolve({ jsnext: true, module: true }) + ] +};