Skip to content

any working sample of encore dev-server? #478

@Alymbek

Description

@Alymbek

Hi, dear comrades!

dos someone successfully worked with encore dev-server?

I just try to use it, the web browser automatically open with this config, but always get error: Cannot GET /

webpack.config.js

my var Encore = require('@symfony/webpack-encore');

////////////////////////////////////////////////////////////////////////////////
Encore
  .setOutputPath('public/build/')
  .setPublicPath('/build')
  .cleanupOutputBeforeBuild()
  .addEntry('full', './assets/js/full.js')
  .enableLessLoader()
  .enableBuildNotifications()
  .enableSourceMaps(!Encore.isProduction())
  .enableVersioning(Encore.isProduction())
  .enableSingleRuntimeChunk()

  .configureFilenames({
    css: 'css/[name]-[hash:6].css',
    js: 'js/[name]-[hash:6].js'
  })


const fullConfig = Encore.getWebpackConfig();
fullConfig.name = 'full';
fullConfig.watchOptions = {
  poll: true,
  ignored: /node_modules/
};
fullConfig.devServer = {
  host: 'localhost',
  port: 8080,
  contentBase: ('/public/'),
  publicPath: 'localhost:8080/build/',
  watchContentBase: false,
  compress: true,
  open: true,
  disableHostCheck:true,
  hot: true,
  progress:true,
};

module.exports = fullConfig;

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug Fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions