Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

VueJS Generating Empty file #120

Closed
ProjectBarks opened this issue Aug 22, 2016 · 8 comments
Closed

VueJS Generating Empty file #120

ProjectBarks opened this issue Aug 22, 2016 · 8 comments

Comments

@ProjectBarks
Copy link

ProjectBarks commented Aug 22, 2016

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
Copy link
Member

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
Copy link
Author

@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
Copy link
Member

LinusBorg commented Aug 22, 2016

Can you post your main.js file?

@ProjectBarks
Copy link
Author

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
Copy link
Member

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

@ProjectBarks
Copy link
Author

ProjectBarks commented Aug 22, 2016

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
Copy link
Author

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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants