Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Webpack looses styles when uglified #24

Closed
@ignaciolarranaga

Description

Steps to reproduce

  • tns create Sample --ng
  • Now add for example yellow background to the sample StackLayout
    app.component.ts:
...
@Component({
 selector: "my-app",
 templateUrl: "app.component.html",
 styleUrls: [ "app.component.css" ]
})
...

app.component.css:

StackLayout {
 background-color: yellow;
}
  • tns install webpack
  • tns prepare ios --emulator --bundle
  • tns run ios --emulator --bundle

Till there all looks correct:
simulator screen shot nov 12 2016 06 49 46

Now add the uglification:

  • npm install webpack --save-dev
  • tns prepare ios --emulator --bundle
  • tns run ios --emulator --bundle
  • Adjust the webpack config:
    webpack.config.js:
var bundler = require("nativescript-dev-webpack");
var webpack = require("webpack");
module.exports = bundler.getConfig({
 plugins: [
 new webpack.optimize.UglifyJsPlugin({
 comments: false,
 compress: { warnings: false }
 })
 ]
});

And there is where the error occurs:
simulator screen shot nov 12 2016 06 55 22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /