JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

Update to Angular 4.0.0

Open ghost opened this issue 9 years ago • 91 comments

Angular 4.0.0 has now been released http://angularjs.blogspot.com.au/2017/03/angular-400-now-available.html with some good improvements

ghost avatar Mar 25 '17 00:03 ghost

I believe it's webpack --config webpack.config.vendor.js. You have to run it from the command line in the directory that your webpack.config.vendor.js file is in.

On Mon, Sep 25, 2017 at 4:08 PM, Colleen [email protected] wrote:

it seems to build when I publish it.. is there an explicit way to re-build vendor?

On Mon, Sep 25, 2017 at 3:06 PM, Adam Amrine [email protected] wrote:

Have you rebuilt your vendor.js file recently?

On Mon, Sep 25, 2017 at 4:02 PM, Colleen [email protected] wrote:

Hi, I looked at your code.. I had tried import 'core-js/client/shim'; before, but my version of core-js must not have shim as i couldn't find a shim sub-directory. Thanks, Colleen

On Mon, Sep 25, 2017 at 2:51 PM, Ebenezer Monney < [email protected]

wrote:

Take a look at how I implemented it here: https://github.com/emonney/ QuickApp/blob/master/src/QuickApp/ClientApp/boot.browser.ts Using core.js sim. The project is based off this repo.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-331992706>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AS0dkp0FMEwP5ZmDp51bMWAiPEoGGUkzks5smARPgaJpZM4Mo5ff>

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-331995634>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AGDtPf8TvDoRhEX64XEb3ZaTJoxz_9nmks5smAbrgaJpZM4Mo5ff>

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-331996501>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AS0dkuICvkAcWJ2mfEjgjQJhAV2lpputks5smAesgaJpZM4Mo5ff> .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/JavaScriptServices/issues/800#issuecomment-331997165, or mute the thread https://github.com/notifications/unsubscribe-auth/AGDtPbat3sIptVQZuDjsNo27Ykaej3qsks5smAhYgaJpZM4Mo5ff .

AmrineA avatar Sep 25 '17 20:09 AmrineA

oh ok.. the application does this when I publish, so i have been building it by publishing

On Mon, Sep 25, 2017 at 3:13 PM, Adam Amrine [email protected] wrote:

I believe it's webpack --config webpack.config.vendor.js. You have to run it from the command line in the directory that your webpack.config.vendor.js file is in.

On Mon, Sep 25, 2017 at 4:08 PM, Colleen [email protected] wrote:

it seems to build when I publish it.. is there an explicit way to re-build vendor?

On Mon, Sep 25, 2017 at 3:06 PM, Adam Amrine [email protected] wrote:

Have you rebuilt your vendor.js file recently?

On Mon, Sep 25, 2017 at 4:02 PM, Colleen [email protected] wrote:

Hi, I looked at your code.. I had tried import 'core-js/client/shim'; before, but my version of core-js must not have shim as i couldn't find a shim sub-directory. Thanks, Colleen

On Mon, Sep 25, 2017 at 2:51 PM, Ebenezer Monney < [email protected]

wrote:

Take a look at how I implemented it here: https://github.com/emonney/ QuickApp/blob/master/src/QuickApp/ClientApp/boot.browser.ts Using core.js sim. The project is based off this repo.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-331992706>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AS0dkp0FMEwP5ZmDp51bMWAiPEoGGUkzks5smARPgaJpZM4Mo5ff>

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-331995634>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AGDtPf8TvDoRhEX64XEb3ZaTJoxz_9nmks5smAbrgaJpZM4Mo5ff>

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-331996501>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AS0dkuICvkAcWJ2mfEjgjQJhAV2lpputks5smAesgaJpZM4Mo5ff> .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-331997165>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AGDtPbat3sIptVQZuDjsNo27Ykaej3qsks5smAhYgaJpZM4Mo5ff>

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/JavaScriptServices/issues/800#issuecomment-331998284, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0dkmTZKnfXFwv1JV6SKqUQk0K_-2Grks5smAlWgaJpZM4Mo5ff .

cbcolleenb avatar Sep 25 '17 20:09 cbcolleenb

I'm not sure if this helps, but here is my package.json. I wouldn't copy it verbatim or you'll get stuff you don't need and remove things you do.

{
  "name": "appname",
  "version": "1.0.0",
  "dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/platform-server": "^4.0.0",
    "@angular/router": "^4.0.0",
    "@types/node": "^7.0.12",
    "angular2-template-loader": "^0.6.2",
    "aspnet-webpack": "^1.0.17",
    "awesome-typescript-loader": "^3.0.0",
    "core-js": "^2.4.1",
    "css": "^2.2.1",
    "css-loader": "^0.28.0",
    "es6-shim": "^0.35.3",
    "es6-promise": "^4.1.0",
    "event-source-polyfill": "^0.0.9",
    "expose-loader": "^0.7.3",
    "extract-text-webpack-plugin": "^2.1.0",
    "file-loader": "^0.11.1",
    "html-loader": "^0.4.5",
    "json-loader": "^0.5.4",
    "preboot": "^4.5.2",
    "raw-loader": "^0.5.1",
    "rxjs": "^5.3.0",
    "style-loader": "^0.16.1",
    "to-string-loader": "^1.1.5",
    "typescript": "^2.2.2",
    "url-loader": "^0.5.8",
    "webpack": "^2.3.3",
    "webpack-hot-middleware": "^2.18.0",
    "webpack-merge": "^4.1.0",
    "zone.js": "^0.8.5",
    "font-awesome": "^4.7.0",
    "ionicons": "^3.0.0",
    "admin-lte": "^2.3.11"
  }
}

Here is my webpack.config.vendor.js:

const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const merge = require('webpack-merge');

module.exports = (env) => {
    const extractCSS = new ExtractTextPlugin('vendor.css');
    const isDevBuild = !(env && env.prod);
    const sharedConfig = {
        stats: { modules: false },
        resolve: { extensions: ['.js'] },
        module: {
            rules: [
                { test: /\.(jpg|png|woff|woff2|eot|ttf|svg)(\?|$)/, use: 'url-loader?limit=100000' }
            ]
        },
        entry: {
            vendor: [
                '@angular/common',
                '@angular/compiler',
                '@angular/core',
                '@angular/forms',
                '@angular/http',
                '@angular/platform-browser',
                '@angular/platform-browser-dynamic',
                '@angular/router',
                '@angular/platform-server',
                'admin-lte/bootstrap/css/bootstrap.css',
                'admin-lte/dist/css/AdminLTE.css',
                'admin-lte/dist/css/skins/skin-black.css',
                'core-js',
                'es6-shim',
                'es6-promise',
                'event-source-polyfill',
                'font-awesome/css/font-awesome.css',
                'ionicons/dist/css/ionicons.css',
                //'jquery',
                'zone.js',
            ]
        },
        output: {
            publicPath: '/dist/',
            filename: '[name].js',
            library: '[name]_[hash]'
        },
        plugins: [
            //new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable)
            new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/, path.join(__dirname, './ClientApp')),
            new webpack.IgnorePlugin(/^vertx$/) // Workaround for https://github.com/stefanpenner/es6-promise/issues/100
        ]
    };

    const clientBundleConfig = merge(sharedConfig, {
        output: { path: path.join(__dirname, 'wwwroot', 'dist') },
        module: {
            rules: [
                { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) }
            ]
        },
        plugins: [
            extractCSS,
            new webpack.DllPlugin({
                path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'),
                name: '[name]_[hash]'
            })
        ].concat(isDevBuild ? [] : [
            new webpack.optimize.UglifyJsPlugin()
        ])
    });

    return [clientBundleConfig];
}

Is there a specific browser you're using? Have you tried other browsers?

AmrineA avatar Sep 25 '17 20:09 AmrineA

ok thanks! I'll look at it and get back tomorrow.

I've been using Chrome primarily but our company still uses IE11. The ngFors are extremely slow in IE11, so that's why I upgraded to Angular4 and better polyfills. I'm hoping this will solve the slowness problem. Did you notice that?

On Mon, Sep 25, 2017 at 3:22 PM, Adam Amrine [email protected] wrote:

I'm not sure if this helps, but here is my package.json. I wouldn't copy it verbatim or you'll get stuff you don't need and remove things you do.

{ "name": "appname", "version": "1.0.0", "dependencies": { "@angular/animations": "^4.0.0", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/platform-server": "^4.0.0", "@angular/router": "^4.0.0", "@types/node": "^7.0.12", "angular2-template-loader": "^0.6.2", "aspnet-webpack": "^1.0.17", "awesome-typescript-loader": "^3.0.0", "core-js": "^2.4.1", "css": "^2.2.1", "css-loader": "^0.28.0", "es6-shim": "^0.35.3", "es6-promise": "^4.1.0", "event-source-polyfill": "^0.0.9", "expose-loader": "^0.7.3", "extract-text-webpack-plugin": "^2.1.0", "file-loader": "^0.11.1", "html-loader": "^0.4.5", "json-loader": "^0.5.4", "preboot": "^4.5.2", "raw-loader": "^0.5.1", "rxjs": "^5.3.0", "style-loader": "^0.16.1", "to-string-loader": "^1.1.5", "typescript": "^2.2.2", "url-loader": "^0.5.8", "webpack": "^2.3.3", "webpack-hot-middleware": "^2.18.0", "webpack-merge": "^4.1.0", "zone.js": "^0.8.5", "font-awesome": "^4.7.0", "ionicons": "^3.0.0", "admin-lte": "^2.3.11" } }

Here is my webpack.config.vendor.js:

const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const merge = require('webpack-merge');

module.exports = (env) => { const extractCSS = new ExtractTextPlugin('vendor.css'); const isDevBuild = !(env && env.prod); const sharedConfig = { stats: { modules: false }, resolve: { extensions: ['.js'] }, module: { rules: [ { test: /.(jpg|png|woff|woff2|eot|ttf|svg)(?|$)/, use: 'url-loader?limit=100000' } ] }, entry: { vendor: [ '@angular/common', '@angular/compiler', '@angular/core', '@angular/forms', '@angular/http', '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/router', '@angular/platform-server', 'admin-lte/bootstrap/css/bootstrap.css', 'admin-lte/dist/css/AdminLTE.css', 'admin-lte/dist/css/skins/skin-black.css', 'core-js', 'es6-shim', 'es6-promise', 'event-source-polyfill', 'font-awesome/css/font-awesome.css', 'ionicons/dist/css/ionicons.css', //'jquery', 'zone.js', ] }, output: { publicPath: '/dist/', filename: '[name].js', library: '[name]_[hash]' }, plugins: [ //new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) new webpack.ContextReplacementPlugin(/angular(\|/)core(\|/)@angular/, path.join(__dirname, './ClientApp')), new webpack.IgnorePlugin(/^vertx$/) // Workaround for https://github.com/stefanpenner/es6-promise/issues/100 ] };

const clientBundleConfig = merge(sharedConfig, {
    output: { path: path.join(__dirname, 'wwwroot', 'dist') },
    module: {
        rules: [
            { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) }
        ]
    },
    plugins: [
        extractCSS,
        new webpack.DllPlugin({
            path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'),
            name: '[name]_[hash]'
        })
    ].concat(isDevBuild ? [] : [
        new webpack.optimize.UglifyJsPlugin()
    ])
});

return [clientBundleConfig];

}

Is there a specific browser you're using? Have you tried other browsers?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/JavaScriptServices/issues/800#issuecomment-332000573, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0dkguaCFwsKK7qHe6RVjoYA9XZXZ97ks5smAt8gaJpZM4Mo5ff .

cbcolleenb avatar Sep 25 '17 20:09 cbcolleenb

Can you send your tsconfig.json and webpack.config.js? Your webpack.config.vendor.js you sent before has some code that is in my webpack.config.js

On Mon, Sep 25, 2017 at 3:24 PM, Colleen [email protected] wrote:

ok thanks! I'll look at it and get back tomorrow.

I've been using Chrome primarily but our company still uses IE11. The ngFors are extremely slow in IE11, so that's why I upgraded to Angular4 and better polyfills. I'm hoping this will solve the slowness problem. Did you notice that?

On Mon, Sep 25, 2017 at 3:22 PM, Adam Amrine [email protected] wrote:

I'm not sure if this helps, but here is my package.json. I wouldn't copy it verbatim or you'll get stuff you don't need and remove things you do.

{ "name": "appname", "version": "1.0.0", "dependencies": { "@angular/animations": "^4.0.0", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/platform-server": "^4.0.0", "@angular/router": "^4.0.0", "@types/node": "^7.0.12", "angular2-template-loader": "^0.6.2", "aspnet-webpack": "^1.0.17", "awesome-typescript-loader": "^3.0.0", "core-js": "^2.4.1", "css": "^2.2.1", "css-loader": "^0.28.0", "es6-shim": "^0.35.3", "es6-promise": "^4.1.0", "event-source-polyfill": "^0.0.9", "expose-loader": "^0.7.3", "extract-text-webpack-plugin": "^2.1.0", "file-loader": "^0.11.1", "html-loader": "^0.4.5", "json-loader": "^0.5.4", "preboot": "^4.5.2", "raw-loader": "^0.5.1", "rxjs": "^5.3.0", "style-loader": "^0.16.1", "to-string-loader": "^1.1.5", "typescript": "^2.2.2", "url-loader": "^0.5.8", "webpack": "^2.3.3", "webpack-hot-middleware": "^2.18.0", "webpack-merge": "^4.1.0", "zone.js": "^0.8.5", "font-awesome": "^4.7.0", "ionicons": "^3.0.0", "admin-lte": "^2.3.11" } }

Here is my webpack.config.vendor.js:

const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const merge = require('webpack-merge');

module.exports = (env) => { const extractCSS = new ExtractTextPlugin('vendor.css'); const isDevBuild = !(env && env.prod); const sharedConfig = { stats: { modules: false }, resolve: { extensions: ['.js'] }, module: { rules: [ { test: /.(jpg|png|woff|woff2|eot|ttf|svg)(?|$)/, use: 'url-loader?limit=100000' } ] }, entry: { vendor: [ '@angular/common', '@angular/compiler', '@angular/core', '@angular/forms', '@angular/http', '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/router', '@angular/platform-server', 'admin-lte/bootstrap/css/bootstrap.css', 'admin-lte/dist/css/AdminLTE.css', 'admin-lte/dist/css/skins/skin-black.css', 'core-js', 'es6-shim', 'es6-promise', 'event-source-polyfill', 'font-awesome/css/font-awesome.css', 'ionicons/dist/css/ionicons.css', //'jquery', 'zone.js', ] }, output: { publicPath: '/dist/', filename: '[name].js', library: '[name]_[hash]' }, plugins: [ //new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) new webpack.ContextReplacementPlugin(/angular(\|/)core(\|/)@angular/, path.join(__dirname, './ClientApp')), new webpack.IgnorePlugin(/^vertx$/) // Workaround for https://github.com/stefanpenner/es6-promise/issues/100 ] };

const clientBundleConfig = merge(sharedConfig, {
    output: { path: path.join(__dirname, 'wwwroot', 'dist') },
    module: {
        rules: [
            { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) }
        ]
    },
    plugins: [
        extractCSS,
        new webpack.DllPlugin({
            path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'),
            name: '[name]_[hash]'
        })
    ].concat(isDevBuild ? [] : [
        new webpack.optimize.UglifyJsPlugin()
    ])
});

return [clientBundleConfig];

}

Is there a specific browser you're using? Have you tried other browsers?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/JavaScriptServices/issues/800#issuecomment-332000573, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0dkguaCFwsKK7qHe6RVjoYA9XZXZ97ks5smAt8gaJpZM4Mo5ff .

cbcolleenb avatar Sep 25 '17 21:09 cbcolleenb

after rebuilding vendor, it's worth to restart IIS if working

2017-09-25 23:05 GMT+02:00 Colleen [email protected]:

Can you send your tsconfig.json and webpack.config.js? Your webpack.config.vendor.js you sent before has some code that is in my webpack.config.js

On Mon, Sep 25, 2017 at 3:24 PM, Colleen [email protected] wrote:

ok thanks! I'll look at it and get back tomorrow.

I've been using Chrome primarily but our company still uses IE11. The ngFors are extremely slow in IE11, so that's why I upgraded to Angular4 and better polyfills. I'm hoping this will solve the slowness problem. Did you notice that?

On Mon, Sep 25, 2017 at 3:22 PM, Adam Amrine [email protected] wrote:

I'm not sure if this helps, but here is my package.json. I wouldn't copy it verbatim or you'll get stuff you don't need and remove things you do.

{ "name": "appname", "version": "1.0.0", "dependencies": { "@angular/animations": "^4.0.0", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/platform-server": "^4.0.0", "@angular/router": "^4.0.0", "@types/node": "^7.0.12", "angular2-template-loader": "^0.6.2", "aspnet-webpack": "^1.0.17", "awesome-typescript-loader": "^3.0.0", "core-js": "^2.4.1", "css": "^2.2.1", "css-loader": "^0.28.0", "es6-shim": "^0.35.3", "es6-promise": "^4.1.0", "event-source-polyfill": "^0.0.9", "expose-loader": "^0.7.3", "extract-text-webpack-plugin": "^2.1.0", "file-loader": "^0.11.1", "html-loader": "^0.4.5", "json-loader": "^0.5.4", "preboot": "^4.5.2", "raw-loader": "^0.5.1", "rxjs": "^5.3.0", "style-loader": "^0.16.1", "to-string-loader": "^1.1.5", "typescript": "^2.2.2", "url-loader": "^0.5.8", "webpack": "^2.3.3", "webpack-hot-middleware": "^2.18.0", "webpack-merge": "^4.1.0", "zone.js": "^0.8.5", "font-awesome": "^4.7.0", "ionicons": "^3.0.0", "admin-lte": "^2.3.11" } }

Here is my webpack.config.vendor.js:

const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const merge = require('webpack-merge');

module.exports = (env) => { const extractCSS = new ExtractTextPlugin('vendor.css'); const isDevBuild = !(env && env.prod); const sharedConfig = { stats: { modules: false }, resolve: { extensions: ['.js'] }, module: { rules: [ { test: /.(jpg|png|woff|woff2|eot|ttf|svg)(?|$)/, use: 'url-loader?limit=100000' } ] }, entry: { vendor: [ '@angular/common', '@angular/compiler', '@angular/core', '@angular/forms', '@angular/http', '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/router', '@angular/platform-server', 'admin-lte/bootstrap/css/bootstrap.css', 'admin-lte/dist/css/AdminLTE.css', 'admin-lte/dist/css/skins/skin-black.css', 'core-js', 'es6-shim', 'es6-promise', 'event-source-polyfill', 'font-awesome/css/font-awesome.css', 'ionicons/dist/css/ionicons.css', //'jquery', 'zone.js', ] }, output: { publicPath: '/dist/', filename: '[name].js', library: '[name]_[hash]' }, plugins: [ //new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) new webpack.ContextReplacementPlugin(/angular(\|/)core(\|/)@angular/, path.join(__dirname, './ClientApp')), new webpack.IgnorePlugin(/^vertx$/) // Workaround for https://github.com/stefanpenner/es6-promise/issues/100 ] };

const clientBundleConfig = merge(sharedConfig, { output: { path: path.join(__dirname, 'wwwroot', 'dist') }, module: { rules: [ { test: /.css(?|$)/, use: extractCSS.extract({ use: 'css-loader' }) } ] }, plugins: [ extractCSS, new webpack.DllPlugin({ path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), name: '[name]_[hash]' }) ].concat(isDevBuild ? [] : [ new webpack.optimize.UglifyJsPlugin() ]) });

return [clientBundleConfig]; }

Is there a specific browser you're using? Have you tried other browsers?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-332000573>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AS0dkguaCFwsKK7qHe6RVjoYA9XZXZ97ks5smAt8gaJpZM4Mo5ff> .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aspnet/JavaScriptServices/issues/800#issuecomment-332012289, or mute the thread https://github.com/notifications/unsubscribe-auth/ATW_NTC_5M0D5L-9Y_3CjtVzz79rThnTks5smBV9gaJpZM4Mo5ff .

k-krupka avatar Sep 25 '17 23:09 k-krupka

Hi Adam, I tried to match as much as possible and still get the error below.. is it possible to send me your tsconfig.json, webpack.config.js, boot-client.ts and boot-server.ts? thanks, Colleen

TypeError: n.replace is not a function at Ie (vendor.js?v=VR6o4twlFeL2-3FmU0tcayQhCR53UZjDReSWrNOnoB0:453) at vendor.js?v=VR6o4twlFeL2-3FmU0tcayQhCR53UZjDReSWrNOnoB0:551 at Array.map () at t.normalizeStylesheet (vendor.js?v=VR6o4twlFeL2-3FmU0tcayQhCR53UZjDReSWrNOnoB0:551) at t.normalizeLoadedTemplate (vendor.js?v=VR6o4twlFeL2-3FmU0tcayQhCR53UZjDReSWrNOnoB0:551) at vendor.js?v=VR6o4twlFeL2-3FmU0tcayQhCR53UZjDReSWrNOnoB0:551 at Object.then (vendor.js?v=VR6o4twlFeL2-3FmU0tcayQhCR53UZjDReSWrNOnoB0:523) at t.normalizeTemplateOnly (vendor.js?v=VR6o4twlFeL2-3FmU0tcayQhCR53UZjDReSWrNOnoB0:551) at t.normalizeTemplate (vendor.js?v=VR6o4twlFeL2-3FmU0tcayQhCR53UZjDReSWrNOnoB0:551) at t.loadDirectiveMetadata

On Mon, Sep 25, 2017 at 3:22 PM, Adam Amrine [email protected] wrote:

I'm not sure if this helps, but here is my package.json. I wouldn't copy it verbatim or you'll get stuff you don't need and remove things you do.

{ "name": "appname", "version": "1.0.0", "dependencies": { "@angular/animations": "^4.0.0", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/platform-server": "^4.0.0", "@angular/router": "^4.0.0", "@types/node": "^7.0.12", "angular2-template-loader": "^0.6.2", "aspnet-webpack": "^1.0.17", "awesome-typescript-loader": "^3.0.0", "core-js": "^2.4.1", "css": "^2.2.1", "css-loader": "^0.28.0", "es6-shim": "^0.35.3", "es6-promise": "^4.1.0", "event-source-polyfill": "^0.0.9", "expose-loader": "^0.7.3", "extract-text-webpack-plugin": "^2.1.0", "file-loader": "^0.11.1", "html-loader": "^0.4.5", "json-loader": "^0.5.4", "preboot": "^4.5.2", "raw-loader": "^0.5.1", "rxjs": "^5.3.0", "style-loader": "^0.16.1", "to-string-loader": "^1.1.5", "typescript": "^2.2.2", "url-loader": "^0.5.8", "webpack": "^2.3.3", "webpack-hot-middleware": "^2.18.0", "webpack-merge": "^4.1.0", "zone.js": "^0.8.5", "font-awesome": "^4.7.0", "ionicons": "^3.0.0", "admin-lte": "^2.3.11" } }

Here is my webpack.config.vendor.js:

const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const merge = require('webpack-merge');

module.exports = (env) => { const extractCSS = new ExtractTextPlugin('vendor.css'); const isDevBuild = !(env && env.prod); const sharedConfig = { stats: { modules: false }, resolve: { extensions: ['.js'] }, module: { rules: [ { test: /.(jpg|png|woff|woff2|eot|ttf|svg)(?|$)/, use: 'url-loader?limit=100000' } ] }, entry: { vendor: [ '@angular/common', '@angular/compiler', '@angular/core', '@angular/forms', '@angular/http', '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/router', '@angular/platform-server', 'admin-lte/bootstrap/css/bootstrap.css', 'admin-lte/dist/css/AdminLTE.css', 'admin-lte/dist/css/skins/skin-black.css', 'core-js', 'es6-shim', 'es6-promise', 'event-source-polyfill', 'font-awesome/css/font-awesome.css', 'ionicons/dist/css/ionicons.css', //'jquery', 'zone.js', ] }, output: { publicPath: '/dist/', filename: '[name].js', library: '[name]_[hash]' }, plugins: [ //new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) new webpack.ContextReplacementPlugin(/angular(\|/)core(\|/)@angular/, path.join(__dirname, './ClientApp')), new webpack.IgnorePlugin(/^vertx$/) // Workaround for https://github.com/stefanpenner/es6-promise/issues/100 ] };

const clientBundleConfig = merge(sharedConfig, {
    output: { path: path.join(__dirname, 'wwwroot', 'dist') },
    module: {
        rules: [
            { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) }
        ]
    },
    plugins: [
        extractCSS,
        new webpack.DllPlugin({
            path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'),
            name: '[name]_[hash]'
        })
    ].concat(isDevBuild ? [] : [
        new webpack.optimize.UglifyJsPlugin()
    ])
});

return [clientBundleConfig];

}

Is there a specific browser you're using? Have you tried other browsers?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/JavaScriptServices/issues/800#issuecomment-332000573, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0dkguaCFwsKK7qHe6RVjoYA9XZXZ97ks5smAt8gaJpZM4Mo5ff .

cbcolleenb avatar Sep 26 '17 14:09 cbcolleenb

tsconfig.json:

{
  "compilerOptions": {
    "moduleResolution": "node",
    "target": "es5",
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "skipDefaultLibCheck": true,
    "lib": [ "es6", "dom" ],
    "types": [ "node" ]
  },
  "exclude": [ "bin", "node_modules" ],
  "atom": { "rewriteTsconfig": false }
}

boot-client.ts

import './polyfills/polyfills.ts';
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
const rootElemTagName = 'app'; // Update this if you change your root component selector

// Enable either Hot Module Reloading or production mode
if (module['hot']) {
    module['hot'].accept();
    module['hot'].dispose(() => {
        // Before restarting the app, we create a new root element and dispose the old one
        const oldRootElem = document.querySelector(rootElemTagName);
        const newRootElem = document.createElement(rootElemTagName);
        oldRootElem.parentNode.insertBefore(newRootElem, oldRootElem);
        platform.destroy();
    });
} else {
    enableProdMode();
}

// Boot the application, either now or when the DOM content is loaded
const platform = platformBrowserDynamic();

const bootApplication = () => { platform.bootstrapModule(AppModule); };
if (document.readyState === 'complete') {
    bootApplication();
} else {
    document.addEventListener('DOMContentLoaded', bootApplication);
}

webpack.config.js

const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;

module.exports = (env) => {
    // Configuration in common to both client-side and server-side bundles
    const isDevBuild = !(env && env.prod);
    const sharedConfig = {
        stats: { modules: false },
        context: __dirname,
        resolve: { extensions: ['.js', '.ts'] },
        output: {
            filename: '[name].js',
            publicPath: '/dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix
        },
        module: {
            rules: [
                { test: /\.ts$/, include: /ClientApp/, use: ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] },
                { test: /\.html$/, use: 'html-loader?minimize=false' },
                { test: /\.css$/, use: ['to-string-loader', 'css-loader'] },
                { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }
            ]
        },
        plugins: [new CheckerPlugin()]
    };

    // Configuration for client-side bundle suitable for running in browsers
    const clientBundleOutputDir = './wwwroot/dist';
    const clientBundleConfig = merge(sharedConfig, {
        entry: { 'main-client': './ClientApp/boot-client.ts' },
        output: { path: path.join(__dirname, clientBundleOutputDir) },
        plugins: [
            new webpack.DllReferencePlugin({
                context: __dirname,
                manifest: require('./wwwroot/dist/vendor-manifest.json')
            })
        ].concat(isDevBuild ? [
            // Plugins that apply in development builds only
            new webpack.SourceMapDevToolPlugin({
                filename: '[file].map', // Remove this line if you prefer inline source maps
                moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk
            })
        ] : [
                // Plugins that apply in production builds only
                new webpack.optimize.UglifyJsPlugin()
            ])
    });

    return [clientBundleConfig];
};

We don't have a boot-server.ts because we removed server side rendering. You may also notice that some of these files have the pieces removed from them that are required for server side rendering. You should be able to disable SSR to see if that is part of the issue.

AmrineA avatar Sep 26 '17 15:09 AmrineA

thanks.. is awesome-typescript-loader part of npm or your own library? can i use ts-loader instead?

On Tue, Sep 26, 2017 at 10:53 AM, Adam Amrine [email protected] wrote:

tsconfig.json:

{ "compilerOptions": { "moduleResolution": "node", "target": "es5", "sourceMap": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "skipDefaultLibCheck": true, "lib": [ "es6", "dom" ], "types": [ "node" ] }, "exclude": [ "bin", "node_modules" ], "atom": { "rewriteTsconfig": false } }

boot-client.ts

import './polyfills/polyfills.ts'; import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; const rootElemTagName = 'app'; // Update this if you change your root component selector

// Enable either Hot Module Reloading or production mode if (module['hot']) { module['hot'].accept(); module['hot'].dispose(() => { // Before restarting the app, we create a new root element and dispose the old one const oldRootElem = document.querySelector(rootElemTagName); const newRootElem = document.createElement(rootElemTagName); oldRootElem.parentNode.insertBefore(newRootElem, oldRootElem); platform.destroy(); }); } else { enableProdMode(); }

// Boot the application, either now or when the DOM content is loaded const platform = platformBrowserDynamic();

const bootApplication = () => { platform.bootstrapModule(AppModule); }; if (document.readyState === 'complete') { bootApplication(); } else { document.addEventListener('DOMContentLoaded', bootApplication); }

webpack.config.js

const path = require('path'); const webpack = require('webpack'); const merge = require('webpack-merge'); const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;

module.exports = (env) => { // Configuration in common to both client-side and server-side bundles const isDevBuild = !(env && env.prod); const sharedConfig = { stats: { modules: false }, context: __dirname, resolve: { extensions: ['.js', '.ts'] }, output: { filename: '[name].js', publicPath: '/dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix }, module: { rules: [ { test: /.ts$/, include: /ClientApp/, use: ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] }, { test: /.html$/, use: 'html-loader?minimize=false' }, { test: /.css$/, use: ['to-string-loader', 'css-loader'] }, { test: /.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, plugins: [new CheckerPlugin()] };

// Configuration for client-side bundle suitable for running in browsers
const clientBundleOutputDir = './wwwroot/dist';
const clientBundleConfig = merge(sharedConfig, {
    entry: { 'main-client': './ClientApp/boot-client.ts' },
    output: { path: path.join(__dirname, clientBundleOutputDir) },
    plugins: [
        new webpack.DllReferencePlugin({
            context: __dirname,
            manifest: require('./wwwroot/dist/vendor-manifest.json')
        })
    ].concat(isDevBuild ? [
        // Plugins that apply in development builds only
        new webpack.SourceMapDevToolPlugin({
            filename: '[file].map', // Remove this line if you prefer inline source maps
            moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk
        })
    ] : [
            // Plugins that apply in production builds only
            new webpack.optimize.UglifyJsPlugin()
        ])
});

return [clientBundleConfig];

};

We don't have a boot-server.ts because we removed server side rendering. You may also notice that some of these files have the pieces removed from them that are required for server side rendering. You should be able to disable SSR to see if that is part of the issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/JavaScriptServices/issues/800#issuecomment-332244164, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0dkjr6LEADfmgQcu86yJ9Oywc02Luoks5smR3qgaJpZM4Mo5ff .

cbcolleenb avatar Sep 26 '17 16:09 cbcolleenb

It would have come from npm. I'm not sure if ts-loader will work. That is what it was using when I pulled down the sample app and I didn't change it.

On Tue, Sep 26, 2017 at 12:11 PM, Colleen [email protected] wrote:

thanks.. is awesome-typescript-loader part of npm or your own library? can i use ts-loader instead?

On Tue, Sep 26, 2017 at 10:53 AM, Adam Amrine [email protected] wrote:

tsconfig.json:

{ "compilerOptions": { "moduleResolution": "node", "target": "es5", "sourceMap": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "skipDefaultLibCheck": true, "lib": [ "es6", "dom" ], "types": [ "node" ] }, "exclude": [ "bin", "node_modules" ], "atom": { "rewriteTsconfig": false } }

boot-client.ts

import './polyfills/polyfills.ts'; import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser- dynamic'; import { AppModule } from './app/app.module'; const rootElemTagName = 'app'; // Update this if you change your root component selector

// Enable either Hot Module Reloading or production mode if (module['hot']) { module['hot'].accept(); module['hot'].dispose(() => { // Before restarting the app, we create a new root element and dispose the old one const oldRootElem = document.querySelector(rootElemTagName); const newRootElem = document.createElement(rootElemTagName); oldRootElem.parentNode.insertBefore(newRootElem, oldRootElem); platform.destroy(); }); } else { enableProdMode(); }

// Boot the application, either now or when the DOM content is loaded const platform = platformBrowserDynamic();

const bootApplication = () => { platform.bootstrapModule(AppModule); }; if (document.readyState === 'complete') { bootApplication(); } else { document.addEventListener('DOMContentLoaded', bootApplication); }

webpack.config.js

const path = require('path'); const webpack = require('webpack'); const merge = require('webpack-merge'); const CheckerPlugin = require('awesome-typescript- loader').CheckerPlugin;

module.exports = (env) => { // Configuration in common to both client-side and server-side bundles const isDevBuild = !(env && env.prod); const sharedConfig = { stats: { modules: false }, context: __dirname, resolve: { extensions: ['.js', '.ts'] }, output: { filename: '[name].js', publicPath: '/dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix }, module: { rules: [ { test: /.ts$/, include: /ClientApp/, use: ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] }, { test: /.html$/, use: 'html-loader?minimize=false' }, { test: /.css$/, use: ['to-string-loader', 'css-loader'] }, { test: /.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, plugins: [new CheckerPlugin()] };

// Configuration for client-side bundle suitable for running in browsers const clientBundleOutputDir = './wwwroot/dist'; const clientBundleConfig = merge(sharedConfig, { entry: { 'main-client': './ClientApp/boot-client.ts' }, output: { path: path.join(__dirname, clientBundleOutputDir) }, plugins: [ new webpack.DllReferencePlugin({ context: __dirname, manifest: require('./wwwroot/dist/vendor-manifest.json') }) ].concat(isDevBuild ? [ // Plugins that apply in development builds only new webpack.SourceMapDevToolPlugin({ filename: '[file].map', // Remove this line if you prefer inline source maps moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk }) ] : [ // Plugins that apply in production builds only new webpack.optimize.UglifyJsPlugin() ]) });

return [clientBundleConfig]; };

We don't have a boot-server.ts because we removed server side rendering. You may also notice that some of these files have the pieces removed from them that are required for server side rendering. You should be able to disable SSR to see if that is part of the issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-332244164>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AS0dkjr6LEADfmgQcu86yJ9Oywc02Luoks5smR3qgaJpZM4Mo5ff>

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/JavaScriptServices/issues/800#issuecomment-332248895, or mute the thread https://github.com/notifications/unsubscribe-auth/AGDtPfkIrBB2V417J3usbG9axzWXHUQrks5smSEigaJpZM4Mo5ff .

AmrineA avatar Sep 26 '17 17:09 AmrineA

Thank you so much for your help.. it worked after I got rid of the server-side rendering code... it hangs up locally, but it works on our dev server after publish. thanks, Colleen

On Tue, Sep 26, 2017 at 12:30 PM, Adam Amrine [email protected] wrote:

It would have come from npm. I'm not sure if ts-loader will work. That is what it was using when I pulled down the sample app and I didn't change it.

On Tue, Sep 26, 2017 at 12:11 PM, Colleen [email protected] wrote:

thanks.. is awesome-typescript-loader part of npm or your own library? can i use ts-loader instead?

On Tue, Sep 26, 2017 at 10:53 AM, Adam Amrine [email protected] wrote:

tsconfig.json:

{ "compilerOptions": { "moduleResolution": "node", "target": "es5", "sourceMap": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "skipDefaultLibCheck": true, "lib": [ "es6", "dom" ], "types": [ "node" ] }, "exclude": [ "bin", "node_modules" ], "atom": { "rewriteTsconfig": false } }

boot-client.ts

import './polyfills/polyfills.ts'; import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser- dynamic'; import { AppModule } from './app/app.module'; const rootElemTagName = 'app'; // Update this if you change your root component selector

// Enable either Hot Module Reloading or production mode if (module['hot']) { module['hot'].accept(); module['hot'].dispose(() => { // Before restarting the app, we create a new root element and dispose the old one const oldRootElem = document.querySelector(rootElemTagName); const newRootElem = document.createElement(rootElemTagName); oldRootElem.parentNode.insertBefore(newRootElem, oldRootElem); platform.destroy(); }); } else { enableProdMode(); }

// Boot the application, either now or when the DOM content is loaded const platform = platformBrowserDynamic();

const bootApplication = () => { platform.bootstrapModule(AppModule); }; if (document.readyState === 'complete') { bootApplication(); } else { document.addEventListener('DOMContentLoaded', bootApplication); }

webpack.config.js

const path = require('path'); const webpack = require('webpack'); const merge = require('webpack-merge'); const CheckerPlugin = require('awesome-typescript- loader').CheckerPlugin;

module.exports = (env) => { // Configuration in common to both client-side and server-side bundles const isDevBuild = !(env && env.prod); const sharedConfig = { stats: { modules: false }, context: __dirname, resolve: { extensions: ['.js', '.ts'] }, output: { filename: '[name].js', publicPath: '/dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix }, module: { rules: [ { test: /.ts$/, include: /ClientApp/, use: ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] }, { test: /.html$/, use: 'html-loader?minimize=false' }, { test: /.css$/, use: ['to-string-loader', 'css-loader'] }, { test: /.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, plugins: [new CheckerPlugin()] };

// Configuration for client-side bundle suitable for running in browsers const clientBundleOutputDir = './wwwroot/dist'; const clientBundleConfig = merge(sharedConfig, { entry: { 'main-client': './ClientApp/boot-client.ts' }, output: { path: path.join(__dirname, clientBundleOutputDir) }, plugins: [ new webpack.DllReferencePlugin({ context: __dirname, manifest: require('./wwwroot/dist/vendor-manifest.json') }) ].concat(isDevBuild ? [ // Plugins that apply in development builds only new webpack.SourceMapDevToolPlugin({ filename: '[file].map', // Remove this line if you prefer inline source maps moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk }) ] : [ // Plugins that apply in production builds only new webpack.optimize.UglifyJsPlugin() ]) });

return [clientBundleConfig]; };

We don't have a boot-server.ts because we removed server side rendering. You may also notice that some of these files have the pieces removed from them that are required for server side rendering. You should be able to disable SSR to see if that is part of the issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-332244164>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AS0dkjr6LEADfmgQcu86yJ9Oywc02Luoks5smR3qgaJpZM4Mo5ff>

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/aspnet/JavaScriptServices/issues/800# issuecomment-332248895>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AGDtPfkIrBB2V417J3usbG9axzWXHUQrks5smSEigaJpZM4Mo5ff>

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/JavaScriptServices/issues/800#issuecomment-332274439, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0dkg7QqzesA5Da5ATbpKiRT-vUeTJeks5smTSxgaJpZM4Mo5ff .

cbcolleenb avatar Sep 27 '17 18:09 cbcolleenb