Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restructure project. attempt #1 #4

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require('../less/main.less');
require('./less/main.less');

import React from 'react';
import ReactDOM from 'react-dom';
Expand Down
2 changes: 1 addition & 1 deletion html/index.html → app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const script = document.createElement('script');
const port = 8080;
script.src = (process.env.HOT) ? `http://localhost:${port}/build/bundle.js` : '../build/bundle.js';
document.write(script.outerHTML);
document.body.appendChild(script);
}
</script>
</html>
File renamed without changes.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
"name": "electron-quick-start",
"version": "0.1.0",
"description": "Get started with Electron quickly, using webpack, react, hot module reloading, and electron-packager.",
"main": "./main.js",
"main": "./src/main.js",
"scripts": {
"webpack-server": "webpack-dev-server --hot --inline",
"webpack": "webpack",
"start": "cross-env HOT=1 electron main.js",
"electron": "electron main.js",
"start": "cross-env HOT=1 electron src/main.js",
"electron": "electron src/main.js",
"packager": "npm run webpack && electron-packager . MyApp"
},
"author": "Ethereal Labs",
"license": "GNU GPLv3",
"dependencies": {
"react": "^0.14.2",
"react-dom": "^0.14.2"
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
"devDependencies": {
"babel-core": "^6.1.21",
"babel-loader": "^6.1.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"babel-core": "^6.23.1",
"babel-loader": "^6.3.2",
"babel-preset-latest": "^6.22.0",
"babel-preset-react": "^6.23.0",
"copy-webpack-plugin": "^0.2.0",
"cross-env": "^2.0.1",
"css-loader": "^0.25.0",
"electron": "^1.3.4",
"electron-packager": "^8.0.0",
"electron": "^1.4.15",
"electron-packager": "^8.5.1",
"less": "^2.7.1",
"less-loader": "^2.2.3",
"react-hot-loader": "^1.3.0",
Expand Down
4 changes: 2 additions & 2 deletions main.js → src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function createWindow () {
mainWindow = new BrowserWindow({width: 800, height: 600});

// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/html/index.html`);
mainWindow.loadURL(`file://${__dirname}/../app/index.html`);

// Open the DevTools.
mainWindow.webContents.openDevTools();
Expand All @@ -24,7 +24,7 @@ function createWindow () {
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
})
});
}

// This method will be called when Electron has finished
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var path = require('path');
var dir_build = path.resolve(__dirname, 'build');
var dir_html = path.resolve(__dirname, 'html');
var dir_html = path.resolve(__dirname, 'app');
var dir_js = path.resolve(__dirname, 'app');

module.exports = {
Expand All @@ -28,7 +28,7 @@ module.exports = {
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['react', 'es2015']
presets: ['react', 'latest']
}
},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
Expand Down