This repository was archived by the owner on Aug 7, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Labels
No labels