Skip to content

Commit

Permalink
Move HA-JS to git submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed Jun 14, 2016
1 parent 3c291d2 commit ec7dfb2
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "home-assistant-js"]
path = home-assistant-js
url = https://github.com/home-assistant/home-assistant-js.git
1 change: 1 addition & 0 deletions home-assistant-js
Submodule home-assistant-js added at 02fb25
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"license": "MIT",
"dependencies": {
"classnames": "^2.2.5",
"home-assistant-js": "git+https://github.com/home-assistant/home-assistant-js.git#a6f5188db0a1eaad613ce29bb3b803f111e73746",
"moment": "^2.13.0"
},
"devDependencies": {
Expand Down
54 changes: 36 additions & 18 deletions script/rollup.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,48 @@
var rollup = require('rollup').rollup;
var babel = require('rollup-plugin-babel');
var uglify = require('rollup-plugin-uglify');
var commonjs = require('rollup-plugin-commonjs');
var nodeResolve = require('rollup-plugin-node-resolve');
// var commonjs = require('rollup-plugin-commonjs');
// var nodeResolve = require('rollup-plugin-node-resolve');

rollup({
entry: 'src/home-assistant.js',
plugins: [
nodeResolve({
jsnext: true,
main: true,
}),
// rollup({
// entry: 'src/home-assistant.js',
// plugins: [
// nodeResolve({
// jsnext: true,
// main: true,
// }),

// commonjs({
// include: 'node_modules/**',
// }),

commonjs({
include: 'node_modules/**',
}),
// babel({
// exclude: 'node_modules/**',
// }),
// uglify(),
// ],
// }).then(function (bundle) {
// return bundle.write({
// format: 'es6',
// // format: 'iife',
// dest: 'build/ui_rollup.js',
// });
// }).catch(function (err) {
// console.error(err);
// });

babel({
exclude: 'node_modules/**',
}),
rollup({
entry: 'src/app-core.js',
plugins: [
babel(),
uglify(),
],
}).then(function (bundle) {
return bundle.write({
format: 'es6',
// format: 'iife',
dest: 'build/ui_rollup.js',
// format: 'es6',
format: 'iife',
dest: 'build/core_rollup.js',
});
}).catch(function (err) {
console.error(err);
});
2 changes: 1 addition & 1 deletion src/app-core.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import HomeAssistant from 'home-assistant-js';
import HomeAssistant from '../home-assistant-js/dist/homeassistant.es6';

const hass = new HomeAssistant();

Expand Down
5 changes: 2 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
entry: {
_ui_compiled: './src/home-assistant.js',
_core_compiled: './src/app-core.js',
_demo_data_compiled: './node_modules/home-assistant-js/demo_data/expose_window.js',
_demo_data_compiled: './home-assistant-js/demo_data/expose_window.js',
},
output: {
path: 'build',
Expand All @@ -23,8 +23,7 @@ module.exports = {
test: /.js$/,
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules/home-assistant-js/demo_data'),
path.resolve(__dirname, 'node_modules/home-assistant-js/src'),
path.resolve(__dirname, 'home-assistant-js'),
],
},
],
Expand Down

0 comments on commit ec7dfb2

Please sign in to comment.