frontend - Sass compiler Phoenix Framework -
i new front-end phoenix framework , trying implement sass, “priv/static/css/app.css” not compiling using “web/static/css/app.scss”. app.css.map file looks this:
{"version":3,"sources":"web/static/css/app.scss","names":[],"mappings":"","file":"priv/static/css/app.css"}
and brunch.config file looks this:
exports.config = { // see http://brunch.io/#documentation docs. files: { scripts: { jointo: "js/app.js" // use separate vendor.js bundle, specify 2 files path // https://github.com/brunch/brunch/blob/stable/docs/config.md#files // jointo: { // "js/app.js": /^(web\/static\/js)/, // "js/vendor.js": /^(web\/static\/vendor)|(deps)/ // } // // change order of concatenation of files, explicitly mention here // https://github.com/brunch/brunch/tree/master/docs#concatenation // order: { // before: [ // "web/static/vendor/js/jquery-2.1.1.js", // "web/static/vendor/js/bootstrap.min.js" // ] // } }, stylesheets: { jointo: "css/app.css" }, templates: { jointo: "js/app.js" } }, conventions: { // option sets should place non-css , non-js assets in. // default, set "/web/static/assets". files in directory // copied `paths.public`, "priv/static" default. assets: /^(web\/static\/assets)/ }, // phoenix paths configuration paths: { // dependencies , current project directories watch watched: [ "web/static", "test/static" ], // compile files public: "priv/static" }, // configure plugins plugins: { babel: { // not use es6 compiler in vendor code ignore: [/web\/static\/vendor/] } sass: { options: { includepaths: ['web/static/vendor/bootstrap-sass/assets/stylesheets'] } } }, modules: { autorequire: { "js/app.js": ["web/static/js/app"] } }, npm: { enabled: true, // whitelist npm deps pulled in front-end assets. // other deps in package. excluded bundle. whitelist: ["phoenix", "phoenix_html"] } };
i error when run node node_modules/brunch/bin/brunch build:
25 apr 09:06:33 - error: initialization error - syntaxerror: unexpected identifier @ exports.runinthiscontext (vm.js:53:16) @ module._compile (module.js:387:25) @ object.module._extensions..js (module.js:422:10) @ module.load (/users/dara.carolan/sites/tomcat/node_modules/coffee-script/lib/coffee-script/register.js:45:36) @ function.module._load (module.js:314:12) @ module.require (module.js:367:17) @ require (internal/module.js:20:19) @ promise.then.config (/users/dara.carolan/sites/tomcat/node_modules/brunch/lib/application.js:458:18) @ object.keys.foreach.environments.foreach.object.keys.map.exports.install.exports.replaceconfigslashes.object.keys.foreach.types.map.type.map.jointo.map.types.foreach.exports.setconfigdefaults.object.keys.foreach.normalized.paths.possibleconfigfiles.object.keys.map.readcomponents.then.promise.then.obj.catch (/users/dara.carolan/sites/tomcat/node_modules/brunch/lib/application.js:450:10) @ object.keys.foreach.environments.foreach.object.keys.map.exports.install.exports.replaceconfigslashes.object.keys.foreach.types.map.type.map.jointo.map.types.foreach.exports.setconfigdefaults.object.keys.foreach.normalized.paths.possibleconfigfiles.object.keys.map.readcomponents.then.promise.then.exports.loadconfig.trytoload.then.config.then.then.then.config.then [as loadconfig] (/users/dara.carolan/sites/tomcat/node_modules/brunch/lib/application.js:496:10) @ new brunchwatcher (/users/dara.carolan/sites/tomcat/node_modules/brunch/lib/watch.js:75:17) @ promise.all.then.setprop.constructor.application.loadconfig.then.then.initcompilation.initwatcher.chokidar.watch.on.on.abspath.on.compile.asseterrors.foreach.promise.all.then.then.watch (/users/dara.carolan/sites/tomcat/node_modules/brunch/lib/watch.js:341:10) @ exports.new.start (/users/dara.carolan/sites/tomcat/node_modules/brunch/lib/index.js:27:10) @ command.listener (/users/dara.carolan/sites/tomcat/node_modules/commander/index.js:301:8) @ emittwo (events.js:100:13) @ command.emit (events.js:185:7) @ command.parseargs (/users/dara.carolan/sites/tomcat/node_modules/commander/index.js:615:12) @ command.parse (/users/dara.carolan/sites/tomcat/node_modules/commander/index.js:458:21) @ object.keys.foreach.exports.run (/users/dara.carolan/sites/tomcat/node_modules/brunch/lib/cli.js:73:11) @ loadbrunch (/users/dara.carolan/sites/tomcat/node_modules/brunch/bin/brunch:34:7) @ /users/dara.carolan/sites/tomcat/node_modules/brunch/bin/brunch:44:5 @ fsreqwrap.oncomplete (fs.js:82:15)
i junior , new phoenix, apologies if have make silly mistake, advice great, thanks!
probably check file /users/dara.carolan/sites/tomcat/node_modules/coffee-script/lib/coffee-script/register.js
seems malformated :)
Comments
Post a Comment