Enable webpack-dev-server hot deploy

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
cloud4288
Posts: 24
Joined: 16 Jun 2011, 11:10

03 Oct 2016, 17:32

I just bought Ultima Theme on PrimeNG, it works perfectly.

I want to enable hot deploy but it seems that the default webpack configuration is not setup for this.

How do I enable it? I tried adding --inline --hot to webpack-dev-server but it doesn't work. I also tried adding module loaders but it still doesn't work.

Any changes made from HTML doesn't automatically refreshes the page. Am I missing a plugin or something?

Image

primeng - 1.0.0-beta.17
angular2 - 2.0.1
webpack - 1.13.2
webpack-dev-server - 1.16.1

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

04 Oct 2016, 09:55

Not a webpack expert here, but I'd suggest webpack-starter for advanced configuration.

https://github.com/AngularClass/angular ... ck-starter

cloud4288
Posts: 24
Joined: 16 Jun 2011, 11:10

05 Oct 2016, 02:45

I will check on that, thanks.

paul.d.carlson
Posts: 33
Joined: 01 Oct 2016, 02:08

07 Oct 2016, 13:17

FWIW, we run our app interactively with Ultima on Angular2 on with web pack. Here's our config files for our dev environment:

(webpack.common.js)
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var helpers = require('./helpers');

module.exports = {
entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'app': './src/main.ts'
// 'login': './src/app/authentication/login.ts'
},


resolve: {
extensions: ['', '.js', '.ts'],
// alias: {
// jquery: "jquery/src/jquery"
// }
},

module: {
loaders: [
{
test: /\.ts$/,
loaders: ['ts', 'angular2-template-loader']
},
{
test: /\.html$/,
loader: 'html'
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file?name=assets/[name].[hash].[ext]'
},
{
test: /\.css$/,
exclude: helpers.root('src', 'app'),
loader: ExtractTextPlugin.extract('style', 'css?sourceMap')
},
{
test: /\.css$/,
include: helpers.root('src', 'app'),
loader: 'raw'
},
// the url-loader uses DataUrls.
// the file-loader emits files.
// { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?mimetype=application/font-woff" },
// { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }
]
},

plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: ['app', 'vendor', 'polyfills']
}),

new HtmlWebpackPlugin({
template: 'src/index.html'
}),

// new HtmlWebpackPlugin({
// template: 'src/login.html'
// }),

new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
]
};


And -

(webppack.dev.js)
var webpackMerge = require('webpack-merge');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var commonConfig = require('./webpack.common.js');
var helpers = require('./helpers');

module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-eval-source-map',

output: {
path: helpers.root('dist'),
publicPath: 'http://localhost:4000/',
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},

plugins: [
new ExtractTextPlugin('[name].css')
],

devServer: {
historyApiFallback: true,
stats: 'minimal'
}
});

cloud4288
Posts: 24
Joined: 16 Jun 2011, 11:10

11 Oct 2016, 02:38

@paul.d.carlson, thanks, your config helped. :)

paul.d.carlson
Posts: 33
Joined: 01 Oct 2016, 02:08

12 Oct 2016, 13:51

Awesome!

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

12 Oct 2016, 20:00

Great, thanks for sharing.

Post Reply

Return to “Ultima - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest