rotundasoftware / parcelify

Add css to your npm modules consumed with browserify.
MIT License
251 stars 20 forks source link

API outputting skeleton Javascript file #22

Closed cowwoc closed 9 years ago

cowwoc commented 9 years ago

When I run parcelify target\classes\..\factor-bundle\com\company\frontend\page\Index.js -j bundle.js -c bundle.css I get fully-populated bundle.js and bundle.css files.

When I attempt to do the same thing using the API:

parcelify("target/classes/../factor-bundle/com/company/frontend/page/Index.js", 
{
    bundles:
    {
        script: "bundle.js",
        style: "bundle.css"
    }
});

I get an identical CSS file, but the JS file only contains this skeleton:

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

},{}]},{},[1])

i've studied cmd.js upwards and downwards but I can't figure out how the two code snippets differ. If I set verbose: true I get the following output:

verb style asset registered "target\sass-temp\com\company\frontend\page\Authentications.css"
verb style asset registered "target\sass-temp\com\company\frontend\page\Cards.css"
verb style asset registered "target\sass-temp\com\company\frontend\page\Index.css"
verb style asset registered "target\sass-temp\com\company\frontend\page\Properties.css"
verb style asset registered "target\sass-temp\com\company\frontend\page\Users.css"
verb style asset registered "target\sass-temp\com\company\frontend\page\util\ResourceTable.css"
verb Created new package C:\Users\Gili\Documents\company\frontend with id 65b6346f1d65eec8b01d374ab3dc4269487dbf0e 

Can you think of anything I could be doing wrong which results in this incorrect JS output?

dgbeck commented 9 years ago

No ideas come to mind. Were you able to figure this out? Can you provide a mini project so that we can reproduce?

cowwoc commented 9 years ago

I ended up giving up and moving to Webpack. Thanks anyway...