Commit Graph

47 Commits

Author SHA1 Message Date
Tor Morten Jensen
8f039f1944 Dispatch event when firing routes
It is especially neat when importing the scripts from the parent theme in a child theme. In one of my themes I do it like this:

```js
// routes.js
import home from './routes/home'

export default {
    home: {
      init() {
        console.log('Home route fired.')
      }
    }
}
```

  ```js
// main.js
/**
 * Parent Themes Script
 */
import '../../../../core-theme/resources/assets/scripts/main';

/**
 * Internal modules
 */
import routes from './routes'

/**
 * Hook in to the parent themes router
 */
document.addEventListener('routed', e => {
  let route = e.detail.route,
    fn = e.detail.fn;

  if (routes[route] && typeof routes[route][fn] === 'function') {
    routes[route][fn]();
  }
});
```
2018-06-20 14:08:10 +02:00
Jason Baciulis
fd2a94fa1b Add uglifyjs plugin (#2070)
* Add uglifyjs plugin and replace -p flag with --env.production
* Add uglifyjs plugin
* Configure UglifyJsPlugin to drop console and prevent eslint error
* Turn off no-console rule because uglifyjs plugin drops it in prod
2018-06-16 08:33:41 -07:00
Nathan Knowler
4a9094b12d Add missing trailing commas in 2f51b51
Forgot to lint.
2018-06-09 10:34:55 -06:00
Nathan Knowler
405aedfb13 Run autoprefixer before minification 2018-06-09 09:49:34 -06:00
Nathan Knowler
2f51b51c95 Enable source comments in Sass 2018-06-09 09:49:08 -06:00
Henning Orth
9dd101f56c Fix travis CI build error (missing trailing comma) 2018-05-28 16:50:49 +02:00
Henning Orth
d1c8a2eee7 Tweaked SVGO settings
Disable removal of the SVG viewBox by default to improve compatibility. See this Discourse thread: https://discourse.roots.io/t/svg-size-change-upon-yarn-build-production/12320
2018-05-28 16:44:12 +02:00
Ben Word
922ed72ad9 Auto-detect scheme 2018-04-25 15:37:28 -06:00
Ben Word
ef28dae253 Merge pull request #2032 from juniorgarcia/master
Added support to .otf fonts
2018-04-25 12:07:12 -06:00
Michael W. Delaney
d3267f06d7 New Sage primary purple 2018-04-12 20:40:22 -04:00
Harry Green
0c11974859 Fix default SVG optimisation configuration 2018-03-19 21:42:47 +00:00
Júnior Garcia
393215507d Added support to .otf fonts 2018-02-19 21:35:58 -03:00
Ben Word
80a00245ab Delete .eslintrc
https://discourse.roots.io/t/console-log-sage-9-eslint/10316/6
2017-12-14 23:04:44 -07:00
Andrew Luca
985fb5e830 Remove some Bower traces 2017-12-11 13:32:32 +02:00
Ben Word
52c08d1454 Change .dev to .test for default local dev TLD per https://github.com/roots/trellis/pull/923 2017-11-18 17:40:46 -07:00
mwdelaney
412740e644 Bootstrap function in _variables.scss to play nice with other frameworks 2017-11-13 16:59:29 -05:00
Michael W. Delaney
7deb83faf2 Move variables and Bootstrap imports to autoload 2017-11-13 16:10:39 -05:00
Michael W. Delaney
e6b15b6e3b Remove explicit Bootstrap lines 2017-11-13 16:10:01 -05:00
mwdelaney
059a89e715 Example $theme-color 2017-11-13 12:44:54 -05:00
Michael W. Delaney
72bfc1ff57 Update main.scss 2017-11-13 12:29:54 -05:00
DieGOs
7ce252939c Update config.json (#1963)
Remove old watch path to controllers
2017-08-31 14:05:59 -07:00
Ben Word
c2a7b5edd0 Add friendly-errors-webpack-plugin (#1961) 2017-08-23 09:50:59 -07:00
Michael W. Delaney
33776e9317 Update webpack.config.js (#1946) 2017-08-12 01:34:44 -07:00
Ben Word
d208fa4b4e 👀 2017-08-11 18:12:25 -06:00
Ben Word
ce754b88df BS4 now requires Popper 2017-08-11 17:59:18 -06:00
Ben Word
505fa357a7 Bootstrap 4 Beta, Sage 9.0.0-beta.4 2017-08-11 17:36:19 -06:00
QWp6t
78473e2fc9 Fix tyop 2017-07-10 04:32:03 -07:00
afbaf8fb2e Update webpack 3.1.0 et al 2017-07-09 07:28:28 -07:00
a83a10ce69 Add config and controllers to BS watch 2017-07-09 07:11:57 -07:00
caea9aa3fd (CS)Add missing trailing comma 2017-07-01 19:48:51 -07:00
Jan Grzegorowski
a429115fb2 Pass config.open to browsersync-webpack-plugin 2017-07-01 19:39:12 -07:00
a67d5001f3 Minimize webpack output 2017-07-01 18:16:27 -07:00
093d1f724d Refactor module (loader) rules
- Removed unnecessary url-loader targeting .woff files
- Replaced file-loader with url-loader (file is fallback for url)
- PostCSS plugins are all loaded manually vs postcss.config.js
2017-07-01 12:49:47 -07:00
d79504bf48 Revert to latest stable version of file-loader 2017-07-01 07:09:40 -07:00
39ac9e7ecc Implement autoload system for styles/scripts 2017-07-01 04:52:49 -07:00
24f0092d53 Remove redundant comments from styles/scripts 2017-07-01 01:44:44 -07:00
0a99ad1db5 Use jsDoc comments in front-end scripts 2017-07-01 01:08:54 -07:00
b8a502def6 Update npm dependencies 2017-06-30 23:56:54 -07:00
cc41cc1e3b Support config-local.json overrides config.json 2017-06-30 21:02:09 -07:00
Ben Word
7e02fdbb6b Update comments, add some more 2017-06-11 17:53:22 -06:00
Ben Word
ae530661cb Merge branch 'master' into dev-stylelint 2017-06-11 17:43:19 -06:00
Julien Melissas
c304c3041d Optimize CSS Assets safe = true (#1901)
Related: https://github.com/roots/sage/pull/1610#issuecomment-182969178
oh word!
2017-06-06 13:15:34 -07:00
Ben
c21df9965f Update Autoprefixer and standardize browserlist location (#1899)
This updates Autoprefixer to 7.1.1, and also moves the browser target
list to package.json, in line with the recommendation made in this
article (https://evilmartians.com/chronicles/autoprefixer-7-browserslist-2-released)
from the developers of Autoprefixer and Browserslist.
2017-05-31 13:09:00 -07:00
Sam Rapaport
d81b85ec48 Fix stylelint errors. 2017-04-24 11:42:59 -07:00
Sam Rapaport
17e7d76377 Add Stylelint linting for scss files. 2017-04-24 11:38:43 -07:00
Ben Word
80728a1b94 Move src/ to app/ 2017-04-03 19:46:52 -06:00
Ben Word
c3e6f1324e assets/ -> resources/assets/ 2017-04-03 18:42:26 -06:00