From c18e2d88e26d89ae4d6f08df6d15f0453058f4bb Mon Sep 17 00:00:00 2001 From: Lucas Rosa Date: Fri, 5 May 2017 14:31:57 -0400 Subject: [PATCH 1/3] attempt to keep src folder pure elm --- config/paths.js | 6 +++--- template/{src => public}/favicon.ico | Bin template/{src => public}/index.html | 0 template/{src => public}/index.js | 2 +- template/{src => public}/logo.svg | 0 template/{src => public}/main.css | 0 6 files changed, 4 insertions(+), 4 deletions(-) rename template/{src => public}/favicon.ico (100%) rename template/{src => public}/index.html (100%) rename template/{src => public}/index.js (78%) rename template/{src => public}/logo.svg (100%) rename template/{src => public}/main.css (100%) diff --git a/config/paths.js b/config/paths.js index ebc82f43..001aca28 100644 --- a/config/paths.js +++ b/config/paths.js @@ -6,10 +6,10 @@ const ownModules = path.resolve(__dirname, '../node_modules') let paths = { appRoot, - entry: path.resolve('./src/index.js'), + entry: path.resolve('./public/index.js'), dist: path.resolve('./dist'), - template: path.resolve('./src/index.html'), - favicon: path.resolve('./src/favicon.ico'), + template: path.resolve('./public/index.html'), + favicon: path.resolve('./public/favicon.ico'), elmPkg: path.resolve('elm-package.json'), scripts: path.resolve(__dirname, '../scripts'), elmMake: path.resolve(__dirname, '../node_modules/.bin/elm-make'), diff --git a/template/src/favicon.ico b/template/public/favicon.ico similarity index 100% rename from template/src/favicon.ico rename to template/public/favicon.ico diff --git a/template/src/index.html b/template/public/index.html similarity index 100% rename from template/src/index.html rename to template/public/index.html diff --git a/template/src/index.js b/template/public/index.js similarity index 78% rename from template/src/index.js rename to template/public/index.js index e93b8eba..e82355fe 100644 --- a/template/src/index.js +++ b/template/public/index.js @@ -1,6 +1,6 @@ import './main.css' const logoPath = require('./logo.svg') -const Elm = require('./App.elm') +const Elm = require('../src/App.elm') const root = document.getElementById('root') diff --git a/template/src/logo.svg b/template/public/logo.svg similarity index 100% rename from template/src/logo.svg rename to template/public/logo.svg diff --git a/template/src/main.css b/template/public/main.css similarity index 100% rename from template/src/main.css rename to template/public/main.css From aa917cc2133c1293576d30769bbe469cbd91c7b8 Mon Sep 17 00:00:00 2001 From: Lucas Rosa Date: Sat, 6 May 2017 16:24:36 -0400 Subject: [PATCH 2/3] more structure --- config/paths.js | 2 +- template/public/{ => css}/main.css | 0 template/public/js/index.js | 8 ++++++++ template/public/{ => media}/logo.svg | 0 4 files changed, 9 insertions(+), 1 deletion(-) rename template/public/{ => css}/main.css (100%) create mode 100644 template/public/js/index.js rename template/public/{ => media}/logo.svg (100%) diff --git a/config/paths.js b/config/paths.js index 001aca28..2fdaaa33 100644 --- a/config/paths.js +++ b/config/paths.js @@ -6,7 +6,7 @@ const ownModules = path.resolve(__dirname, '../node_modules') let paths = { appRoot, - entry: path.resolve('./public/index.js'), + entry: path.resolve('./public/js/index.js'), dist: path.resolve('./dist'), template: path.resolve('./public/index.html'), favicon: path.resolve('./public/favicon.ico'), diff --git a/template/public/main.css b/template/public/css/main.css similarity index 100% rename from template/public/main.css rename to template/public/css/main.css diff --git a/template/public/js/index.js b/template/public/js/index.js new file mode 100644 index 00000000..8f73776c --- /dev/null +++ b/template/public/js/index.js @@ -0,0 +1,8 @@ +import '../css/main.css'; + +const logoPath = require('../media/logo.svg'); +const Elm = require('../../src/App.elm'); + +const root = document.getElementById('root'); + +Elm.App.embed(root, logoPath) diff --git a/template/public/logo.svg b/template/public/media/logo.svg similarity index 100% rename from template/public/logo.svg rename to template/public/media/logo.svg From ce4f8705ce488016c24dc9d56a5ee0e9aaab51c7 Mon Sep 17 00:00:00 2001 From: Lucas Rosa Date: Thu, 1 Jun 2017 10:58:56 -0400 Subject: [PATCH 3/3] extra index.js --- template/public/index.js | 7 ------- template/public/js/index.js | 8 ++++---- 2 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 template/public/index.js diff --git a/template/public/index.js b/template/public/index.js deleted file mode 100644 index e82355fe..00000000 --- a/template/public/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import './main.css' -const logoPath = require('./logo.svg') -const Elm = require('../src/App.elm') - -const root = document.getElementById('root') - -Elm.App.embed(root, logoPath) diff --git a/template/public/js/index.js b/template/public/js/index.js index 8f73776c..c187b5cd 100644 --- a/template/public/js/index.js +++ b/template/public/js/index.js @@ -1,8 +1,8 @@ -import '../css/main.css'; +import '../css/main.css' -const logoPath = require('../media/logo.svg'); -const Elm = require('../../src/App.elm'); +const logoPath = require('../media/logo.svg') +const Elm = require('../../src/App.elm') -const root = document.getElementById('root'); +const root = document.getElementById('root') Elm.App.embed(root, logoPath)