Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jarvis in Vagrant #139

Open
alexis-regnaud opened this issue Jul 24, 2018 · 0 comments
Open

Jarvis in Vagrant #139

alexis-regnaud opened this issue Jul 24, 2018 · 0 comments

Comments

@alexis-regnaud
Copy link

Hi,

I try to install Jarvis for a project in my vagrant but without success...

I add the package corretly, I configure my webpack.config and my VagrantFile, but in return I have the message : " This page does not work " on http://localhost:1337/

Next it's my webpack configuration :

// webpack.config.js
var Encore = require('@symfony/webpack-encore');

var path = require('path');

const Jarvis = require("webpack-jarvis");

console.log( path.resolve(__dirname, './web'));

Encore
// the project directory where all compiled assets will be stored
    .setOutputPath('web/build/')

    // the public path used by the web server to access the previous directory
    .setPublicPath('/build')


    /** Add entry **/

/*
    .createSharedEntry('vendor', [
        './node_modules/epic-spinners/dist/lib/epic-spinners.min.css',
    ])
*/

    // will create public/build/app.js and public/build/app.css
    .addEntry('polyfill', ["babel-polyfill"])
    .addEntry('app', './web/assets/js/app.js')
    .addEntry('entrypoint', './app/Resources/views/front/entrypoint.js')
    .addEntry('unityload', './web/assets/unity_map/Build/UnityLoader.js')

    //Style
    .addStyleEntry('app_style',[
        './web/assets/scss/app.scss'
    ])

     /***************/


    // allow legacy applications to use $/jQuery as a global variable
    .autoProvidejQuery()

    // enable source maps during development
    .enableSourceMaps(!Encore.isProduction())

    // empty the outputPath dir before each build
    .cleanupOutputBeforeBuild()

    // show OS notifications when builds finish/fail
    .enableBuildNotifications()

    // create hashed filenames (e.g. app.abc123.css)
    .enableVersioning(Encore.isProduction())

    // allow sass/scss files to be processed
    .enableSassLoader(function(sassOptions) {}, {
        resolveUrlLoader: false
    })

    // to enable vue
    .enableVueLoader()

    .enablePostCssLoader((options) => {
          options.config = {
                  path: './postcss.config.js'
          };
     })


    /** Add plugin **/

    .addPlugin(
        new Jarvis({
        port: 1337 // optional: set a port
    }))

    /***************/

;


let config = Encore.getWebpackConfig();
config.resolve.alias = {
    'assets': path.resolve(__dirname, './web/assets')
};


// export the final configuration
module.exports = config;
//module.exports = Encore.getWebpackConfig();


And it's my VagrantFile with the forwared port :

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.provision :shell, path: "bootstrap.sh"
  config.vm.network :forwarded_port, guest: 22, host: 2205, id: "ssh" #ssh
  config.vm.network :forwarded_port, guest: 80, host: 8005 #web
  config.vm.network "forwarded_port", guest: 3306, host: 33605 #mysql
  config.vm.network "forwarded_port", guest: 1337, host: 1337 #jarvis

  config.vm.synced_folder ".", "/var/www/html", type: "rsync",
    rsync__exclude: [".idea", ".git/", "vendor/", "var/cache", "var/logs" "web/.htaccess", "web/bundles", "web/css", "web/js", "node_modules", "web/dist"]

  config.vm.hostname = "edfedays"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "129472"
    vb.cpus = "4"
  end
end

Thank you in advance !!

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

No branches or pull requests

1 participant