vuejs / vueify

Browserify transform for single-file Vue components
MIT License
1.17k stars 152 forks source link

VueJS Generating Empty file #120

Closed ProjectBarks closed 6 years ago

ProjectBarks commented 8 years ago

Initial Context #118

Hi I would like to open this issue backup @LinusBorg and @yyx990803. So after some more changes to the code the build ended up failing again. It was working for a bit but I realized that when it was working it wasn't importing everything so the entire components/ directory was not being included. Furthermore, after some more changes to the core code vueify is not generating anything at all. The link to the repository is here if you would like to take a look. The file I am using to test is test.js. And all I do is run node test.js and after it executes I look at the results in build/bundle.js and for some reason there appears to be an empty file and nothing else. Any insight would be great!

test.js

const browserify = require("browserify");
const babelify = require("babelify");
const vueify = require("vueify");
const fs = require("fs");
const debug = require("gulp-debug");

console.log("Starting");
process.env.NODE_ENV = 'development';
const browserConfig = {
    entries: 'app/src/main.js',
    extension: ['.js', '.vue'],
    debug: true
};
browserify(browserConfig)
    .ignore('electron')
    .transform(vueify, {babel: {presets: ["es2015"]}})
    .transform(babelify, {presets: ["es2015"]})
    .bundle()
    .pipe(fs.createWriteStream('build/bundle.js'));

console.log("Done");

Let me know if you guys need anything else.

LinusBorg commented 8 years ago

It was working for a bit but I realized that when it was working it wasn't importing everything so the entire components/ directory was not being included.

Are you maybe using the standalone build (vue/dist/vue)?

Then read this:

https://github.com/vuejs/vue/wiki/Vue-2.0-RC-Starter-Resources#standalone-vs-runtime-builds

ProjectBarks commented 8 years ago

@LinusBorg We do not use the standalone version. We use vueify which builds our code. However the code seems to still be empty. If you take a look at test.js as pasted above that is all we are doing.

LinusBorg commented 8 years ago

Can you post your main.js file?

ProjectBarks commented 8 years ago
import Vue from 'vue';
import electron from 'vue-electron';
import resource from 'vue-resource';
import App from './app.vue';
import 'materialize-css';

Vue.use(electron);
Vue.use(resource);
Vue.config.debug = true;

/* eslint-disable no-new */
new Vue({
    el: 'body',
    components: {App}
});

@LinusBorg

LinusBorg commented 8 years ago

Looks fine, the problem must be somewhere else. Unfortunately, gulp setups are not my strong suit.

ProjectBarks commented 8 years ago

Well I mean the test.js isn't gulp. It's just browserify. But I feel like the problem is rooted in vueify. Or our files causing vueify to fail. I am not really sure what is going on and I have tried doing a lot of debugging. @LinusBorg If you would be able to help me in steps for debugging that would probably help a lot. Or even point me to someone who would know what to do.

ProjectBarks commented 8 years ago

UPDATE 08/22/16 So after running the browserify command I fixed a bunch of errors in my code and then reran the build process and it succeeded. I will post an update once I figure out how to get errors out of browserify/vueify

ryno1234 commented 6 years ago

@ProjectBarks, do you remember what you did to fix this? I'm having the same issue.