This repository has been archived by the owner on Jun 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ludo Bak
committed
Sep 30, 2019
0 parents
commit 6430cd6
Showing
12 changed files
with
4,290 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/env", | ||
{ | ||
"targets": { | ||
"browsers": ["last 2 versions"] | ||
} | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
parserOptions: { | ||
ecmaVersion: 6, | ||
sourceType: "module" | ||
}, | ||
env: { | ||
es6: true, | ||
node: true, | ||
browser: true | ||
}, | ||
extends: "eslint:recommended", | ||
rules: { | ||
"no-console": 0, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rules: | ||
extends-before-mixins: 2 | ||
extends-before-declarations: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
const funnel = require('broccoli-funnel'); | ||
const merge = require('broccoli-merge-trees'); | ||
const compileSass = require('broccoli-sass-source-maps')(require('sass')); | ||
const esLint = require("broccoli-lint-eslint"); | ||
const sassLint = require("broccoli-sass-lint"); | ||
const Rollup = require("broccoli-rollup"); | ||
const LiveReload = require('broccoli-livereload'); | ||
const CleanCss = require('broccoli-clean-css'); | ||
const log = require('broccoli-stew').log; | ||
const babel = require("rollup-plugin-babel"); | ||
const nodeResolve = require('rollup-plugin-node-resolve'); | ||
const commonjs = require('rollup-plugin-commonjs'); | ||
const uglify = require('rollup-plugin-uglify').uglify; | ||
const env = require('broccoli-env').getEnv() || 'development'; | ||
const isProduction = env === 'production'; | ||
|
||
console.log('Environmental: ' + env); | ||
|
||
const appRoot = "app"; | ||
|
||
const html = funnel(appRoot, { | ||
files: ["index.html"], | ||
annotation: "Index file", | ||
}); | ||
|
||
let js = esLint(appRoot, { | ||
persist: true | ||
}); | ||
|
||
const rollupPlugins = [ | ||
nodeResolve({ | ||
jsnext: true, | ||
browser: true, | ||
}), | ||
commonjs({ | ||
include: 'node_modules/**', | ||
}), | ||
babel({ | ||
exclude: 'node_modules/**', | ||
}), | ||
]; | ||
|
||
if (isProduction) { | ||
rollupPlugins.push(uglify()); | ||
} | ||
|
||
js = new Rollup(js, { | ||
inputFiles: ['**/*.js'], | ||
rollup: { | ||
input: 'app.js', | ||
output: { | ||
file: 'assets/app.js', | ||
format: 'es', | ||
sourcemap: !isProduction, | ||
}, | ||
plugins: rollupPlugins, | ||
} | ||
}); | ||
|
||
let css = sassLint(appRoot + '/styles', { | ||
disableTestGenerator: true, | ||
}); | ||
|
||
css = compileSass( | ||
[appRoot], | ||
'styles/main.scss', | ||
'assets/app.css', | ||
{ | ||
sourceMap: !isProduction, | ||
sourceMapContents: true, | ||
annotation: "Sass files" | ||
} | ||
); | ||
|
||
if (isProduction) { | ||
css = new CleanCss(css); | ||
} | ||
|
||
const public = funnel('public', { | ||
annotation: "Public files", | ||
}); | ||
|
||
let tree = merge([html, js, css, public], {annotation: "Final output"}); | ||
|
||
if (!isProduction) { | ||
tree = log(tree, { | ||
output: 'tree', | ||
}); | ||
|
||
tree = new LiveReload(tree, { | ||
target: 'index.html', | ||
}); | ||
} | ||
|
||
module.exports = tree; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Full Broccoli setup for nGlem. | ||
|
||
This is meant as an example of how we could use Broccoli and its |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!doctype html><html> | ||
<head> | ||
<title>Broccoli nGlem</title> | ||
<link rel="stylesheet" href="/assets/app.css" /> | ||
</head> | ||
<body> | ||
<p> nGlem!</p> | ||
<img src="/images/nglem-logo.jpeg" /> | ||
<script src="/assets/app.js"></script> | ||
</body> | ||
</html> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"scripts": { | ||
"build": "node $NODE_DEBUG_OPTION $(which broccoli) build --overwrite", | ||
"serve": "node $NODE_DEBUG_OPTION $(which broccoli) serve", | ||
"build-prod": "BROCCOLI_ENV=production node $NODE_DEBUG_OPTION $(which broccoli) build --overwrite" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.1.0", | ||
"broccoli": "^2.0.0-beta.4", | ||
"broccoli-clean-css": "^2.0.1", | ||
"broccoli-cli": "^1.0.0", | ||
"broccoli-env": "^0.0.1", | ||
"broccoli-funnel": "^2.0.1", | ||
"broccoli-lint-eslint": "^3.3.2", | ||
"broccoli-livereload": "^1.3.0", | ||
"broccoli-merge-trees": "^3.0.0", | ||
"broccoli-rollup": "^2.1.1", | ||
"broccoli-sass-lint": "^1.1.2", | ||
"broccoli-sass-source-maps": "^4.0.0", | ||
"broccoli-stew": "^2.0.0", | ||
"rollup": "^0.66.2", | ||
"rollup-plugin-babel": "^4.0.3", | ||
"rollup-plugin-commonjs": "^9.1.8", | ||
"rollup-plugin-node-resolve": "^3.4.0", | ||
"rollup-plugin-uglify": "^3.0.0", | ||
"sass": "^1.14.0" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.