I'm newbie in webpack, nodejs and angular, but I managed to make an app, it works fine in development environment, and I made a build with "webpack -p", the static files are generated (bundle.js and others), but my app doesnt load!, I'm trying to access it as normal but I get an error "GET http://localhost:8090/dashboard net::ERR_CONNECTION_REFUSED" like the web server is down (and of course is down because webpack-dev-server is not running!), I just dont get what should I do to make the app work without webpack-dev-server, I know it´s a missing concept I dont have. Please help!!!, pleeeease!!!, I'm stuck here for weeks!!.
kensplanet, I just checked the code and I didn't found it too different from my project (except for the good practices that you follow of course :) ), my webpack config seems fine, I copyed the index.html file and used my bundle.js and I still got the same error.
So you know my dev env: OS: Windows 7 SP1 NodeJS: v4.4.5 AngularJS: 1.5.7 Webpack: 1.13.1 ExpressJS: 4.14.0 (The database is in MySQL), I'm using a UI components library to facilitate the front end (angular-ui.github.io/bootstrap/).
This is the error that I get:
dateparser.js:1 Uncaught TypeError: e.module is not a function
at Object.<anonymous> (http://localhost:8080/muestras/public/bundle.js:26:11086)
at Object.<anonymous> (http://localhost:8080/muestras/public/bundle.js:26:18044)
at t (http://localhost:8080/muestras/public/bundle.js:1:107)
at Object.<anonymous> (http://localhost:8080/muestras/public/bundle.js:26:18100)
at Object.<anonymous> (http://localhost:8080/muestras/public/bundle.js:26:18198)
at t (http://localhost:8080/muestras/public/bundle.js:1:107)
at Object.<anonymous> (http://localhost:8080/muestras/public/bundle.js:27:5019)
at Object.<anonymous> (http://localhost:8080/muestras/public/bundle.js:27:5303)
at t (http://localhost:8080/muestras/public/bundle.js:1:107)
at Object.<anonymous> (http://localhost:8080/muestras/public/bundle.js:26:18254)
When I see the details in dateparser.js and I get a error sign in this line:
angular.module('ui.bootstrap.dateparser', [])
.service('uibDateParser', ['$log', '$locale', 'dateFilter', .....
This is my webpack file for development:
var webpack = require('webpack');
var path = require('path');
module.exports = {
devtool: 'inline-source-map',
entry: [
'webpack-dev-server/client?http://127.0.0.1:8090/',
'webpack/hot/only-dev-server',
'bootstrap-loader',
'./src'
],
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
resolve: {
modulesDirectories: ['node_modules', 'src'],
extension: ['', '.js']
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015']
}
},
{
test: /\.html$/,
loader: 'raw'
},
{
test: /\.scss$/,
loaders: [
'style',
'css',
'autoprefixer?browsers=last 3 versions',
'sass?outputStyle=expanded'
]
},
{
test: /\.(woff2?|ttf|eot|svg)$/,
loader: 'url?limit=10000'
},
{
test: /bootstrap-sass\/assets\/javascripts\//,
loader: 'imports?jQuery=jquery'
},
{
test: /\.css$/,
loader: "style-loader!css-loader"
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.ProvidePlugin({
jQuery: "jquery"
})
],
devServer: {
hot: true,
proxy: {
'*': 'http://localhost:3000'
}
}
};