Permalink
Browse files

Initial switch from Brunch to Webpack. Still needs Sass pipeline.

  • Loading branch information...
1 parent 910c2a0 commit 935b7c5689b7dbe953b8378f55917dcde0216b56 @jerodsanto jerodsanto committed Jul 10, 2016
View
@@ -1,80 +0,0 @@
-exports.config = {
- // See http://brunch.io/#documentation for docs.
- files: {
- javascripts: {
- joinTo: {
- "js/app.js": [
- "node_modules/phoenix/priv/static/phoenix.js",
- "node_modules/phoenix_html/priv/static/phoenix_html.js",
- /^(web\/static\/js\/shared)/,
- /^(web\/static\/js\/app)/
- ],
- "js/admin.js": [
- "node_modules/phoenix/priv/static/phoenix.js",
- "node_modules/phoenix_html/priv/static/phoenix_html.js",
- "web/static/vendor/jquery-2.1.4.js",
- "web/static/vendor/semantic.js",
- "web/static/vendor/handlebars-v4.0.5.js",
- "web/static/vendor/sortable.js",
- /^(web\/static\/js\/shared)/,
- /^(web\/static\/js\/admin)/
- ]
- }
- },
- stylesheets: {
- joinTo: {
- "css/app.css": /^(web\/static\/css\/app)/,
- "css/admin.css": [
- "web/static/vendor/semantic.css",
- /^(web\/static\/css\/admin)/
- ],
- "css/email.css": /^(web\/static\/css\/email)/,
- }
- },
- templates: {
- joinTo: {
- "js/app.js": /^(web\/static\/js\/app\/templates)/,
- "js/admin.js": /^(web\/static\/js\/admin\/templates)/
- }
- }
- },
-
- conventions: {
- // This option sets where we should place non-css and non-js assets in.
- // By default, we set this to "/web/static/assets". Files in this directory
- // will be copied to `paths.public`, which is "priv/static" by default.
- assets: /^(web\/static\/assets)/
- },
-
- // Phoenix paths configuration
- paths: {
- // Dependencies and current project directories to watch
- watched: [
- "web/static",
- "test/static"
- ],
-
- // Where to compile files to
- public: "priv/static"
- },
-
- // Configure your plugins
- plugins: {
- babel: {
- // Do not use ES6 compiler in vendor code
- ignore: [/web\/static\/vendor/]
- }
- },
-
- modules: {
- autoRequire: {
- "js/app.js": ["web/static/js/app"],
- "js/admin.js": ["web/static/js/admin"]
- }
- },
-
- npm: {
- enabled: true,
- whitelist: ["phoenix", "phoenix_html"]
- }
-};
View
@@ -12,8 +12,7 @@ config :changelog, Changelog.Endpoint,
code_reloader: true,
cache_static_lookup: false,
check_origin: false,
- watchers: [node: ["node_modules/brunch/bin/brunch", "watch", "--stdin",
- cd: Path.expand("../", __DIR__)]]
+ watchers: [npm: ["start", cd: Path.expand("../", __DIR__)]]
# Watch static and templates for browser reloading.
config :changelog, Changelog.Endpoint,
View
@@ -1,14 +1,22 @@
{
"repository": {},
"dependencies": {
- "babel-brunch": "^6.0.0",
- "brunch": "^2.1.1",
- "clean-css-brunch": ">= 1.0 < 1.8",
- "css-brunch": ">= 1.0 < 1.8",
- "javascript-brunch": ">= 1.0 < 1.8",
- "uglify-js-brunch": ">= 1.0 < 1.8",
- "handlebars-brunch": "^1.10.1",
+ "jquery": "^3.1.0",
"phoenix": "file:deps/phoenix",
- "phoenix_html": "file:deps/phoenix_html"
+ "phoenix_html": "file:deps/phoenix_html",
+ "sortablejs": "^1.4.2"
+ },
+ "devDependencies": {
+ "babel-core": "^6.10.4",
+ "babel-loader": "^6.2.4",
+ "babel-preset-es2015": "^6.9.0",
+ "copy-webpack-plugin": "^3.0.1",
+ "handlebars-loader": "^1.3.0",
+ "webpack": "^1.13.1",
+ "webpack-merge": "^0.14.0"
+ },
+ "scripts": {
+ "start": "webpack --watch-stdin --progress --color",
+ "compile": "webpack -p"
}
}
Binary file not shown.
@@ -1,15 +1,16 @@
-import "phoenix_html"
-import channelView from "./admin/views/channelView"
-import episodeView from "./admin/views/episodeView"
-import podcastView from "./admin/views/podcastView"
-import postView from "./admin/views/postView"
+import "phoenix_html";
+
+import channelView from "admin/views/channelView";
+import episodeView from "admin/views/episodeView";
+import podcastView from "admin/views/podcastView";
+import postView from "admin/views/postView";
let views = {
"ChannelView": channelView,
"PodcastView": podcastView,
"EpisodeView": episodeView,
"PostView": postView
-}
+};
let timeString = function(date) {
let month = date.getMonth() + 1;
@@ -37,7 +38,6 @@ let timeString = function(date) {
return `${month}/${year}/${day} โ€“ย ${hours}${minutes}${amPm} ${tz}`;
}
-$("#sidebar").sidebar({context: $("#main")});
$("a[rel=external]").attr("target", "_blank");
$("input[readonly]").popup({
content: "Read-only because danger. Use the console if you really need to edit this.",
@@ -1,4 +1,4 @@
-import linkItem from "../templates/linkItem"
+import linkItem from "admin/templates/linkItem.hbs"
export default class ListWidget {
constructor(parentType, relationType) {
@@ -1,6 +1,8 @@
-import personItem from "../templates/personItem"
-import channelItem from "../templates/channelItem"
-import sponsorItem from "../templates/sponsorItem"
+import Sortable from "sortablejs";
+
+import personItem from "admin/templates/personItem.hbs";
+import channelItem from "admin/templates/channelItem.hbs";
+import sponsorItem from "admin/templates/sponsorItem.hbs";
export default class SearchWidget {
constructor(type, parentType, relationType) {
@@ -1,4 +1,4 @@
-import Slugifier from "../components/slugifier"
+import Slugifier from "../components/slugifier";
export default class ChannelView {
new() {
@@ -1,4 +1,4 @@
-import SearchWidget from "../components/searchWidget"
+import SearchWidget from "../components/searchWidget";
export default class EpisodeView {
new() {
View
@@ -1,21 +1,2 @@
-// Brunch automatically concatenates all files in your
-// watched paths. Those paths can be configured at
-// config.paths.watched in "brunch-config.js".
-//
-// However, those files will only be executed if
-// explicitly imported. The only exception are files
-// in vendor, which are never wrapped in imports and
-// therefore are always executed.
-
-// Import dependencies
-//
-// If you no longer want to use a dependency, remember
-// to also remove its path from "config.paths.watched".
-// import "phoenix_html"
-
-// Import local files
-//
-// Local files can be imported directly using relative
-// paths "./socket" or full ones "web/static/js/socket".
-
+// import "phoenix_html";
// import socket from "./shared/socket"
Oops, something went wrong.

0 comments on commit 935b7c5

Please sign in to comment.