Closed robinplace closed 7 years ago
@robbiewxyz Thanks for your interest! But modules and riot scope is a brunch part. Plugins is just compilers.
You can specify riot as dependency in package.json
and then get access using var riot = require('riot');
in any of your modules. Moreover, you can use:
npm: { globals: {
riot: "riot"
}}
in your brunch config.
If you are using riot from separate vendor file, brunch docs says:
All files from vendor directory are by default concatenated before all files from app directory
riot-brunch assumes that we have the
riot
global available, meaning I have to addriot.js
as a vendor script. This is unnecessary as we're downloading it from the NPM anyway and it can be included with a simplerequire
. This way also means polluting the global scope.This change does things in what I feel is the "CommonJS way". The code comes from https://github.com/jhthorsen/riotify/blob/master/index.js#L16 . We eliminate the vendor script and the global.
Hopefully this helps cut down on configuration clutter for everyone :grinning: .