Created
May 25, 2017 15:34
-
-
Save davejlong/43770d08acea6f87091e1055e2975703 to your computer and use it in GitHub Desktop.
Example brunch-config.js to load SimpleMDE into Phoenix
This file contains hidden or 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
exports.config = { | |
// See http://brunch.io/#documentation for docs. | |
files: { | |
javascripts: { | |
joinTo: { | |
"js/app.js": /^(web\/static\/js\/frontend)|(node_modules)/, | |
"js/admin.js": /^(web\/static\/js\/admin)|(node_modules)/, | |
"js/ex_admin_common.js": ["web/static/vendor/ex_admin_common.js"], | |
"js/admin_lte2.js": ["web/static/vendor/admin_lte2.js"], | |
"js/jquery.min.js": ["web/static/vendor/jquery.min.js"] | |
} | |
}, | |
stylesheets: { | |
joinTo: { | |
"css/app.css": /^(web\/static\/css)/, | |
"css/admin_lte2.css": ["web/static/vendor/admin_lte2.css"], | |
"css/active_admin.css.css": ["web/static/vendor/active_admin.css.css"], | |
"css/simplemde.min.css": ["node_modules/simplemde/dist/simplemde.min.css"] | |
}, | |
order: { | |
after: ["web/static/css/app.css"] // concat app.css last | |
} | |
}, | |
templates: { | |
joinTo: "js/app.js" | |
} | |
}, | |
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/, /node_modules\/simplemde\/dist/] | |
} | |
}, | |
modules: { | |
autoRequire: { | |
"js/app.js": ["web/static/js/app"] | |
} | |
}, | |
npm: { | |
styles: { | |
simplemde: ['dist/simplemde.min.css'] | |
}, | |
globals: { | |
'SimpleMDE': 'simplemde' | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment