Skip to content

Anders customizations #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# `react-scripts-ts` [![npm version](https://badge.fury.io/js/react-scripts-ts.svg)](https://badge.fury.io/js/react-scripts-ts) [![Build Status](https://travis-ci.org/wmonk/create-react-app-typescript.svg?branch=master)](https://travis-ci.org/wmonk/create-react-app-typescript)
# `react-scripts-ts-ai` [![Build Status](https://travis-ci.org/andersinno/create-react-app-ai.svg?branch=master)](https://travis-ci.org/andersinno/create-react-app-ai)

#### This is a fork of [wmonk/create-react-app-typescript](https://github.com/wmonk/create-react-app-typescript)

Create React apps (with Typescript) with no build configuration.

Expand All @@ -9,7 +11,7 @@ _Do you know react and want to try out typescript? Or do you know typescript and
```sh
npm install -g create-react-app

create-react-app my-app --scripts-version=react-scripts-ts
create-react-app my-app --scripts-version=react-scripts-ts-ai
cd my-app/
npm start
```
Expand Down
43 changes: 43 additions & 0 deletions packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,15 @@ module.exports = {
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
sourceMap: true,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
sourceMap: true,
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
Expand All @@ -207,6 +209,47 @@ module.exports = {
},
],
},
{
test: /\.(sass|scss)$/,
fallback: require.resolve('style-loader'),
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
sourceMap: true,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
sourceMap: true,
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
{
loader: require.resolve('sass-loader'),
options: {
sourceMap: true,
},
},
],
},
// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.
Expand Down
48 changes: 48 additions & 0 deletions packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,54 @@ module.exports = {
),
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
{
test: /\.(sass|scss)$/,
loader: ExtractTextPlugin.extract(
Object.assign(
{
fallback: require.resolve('style-loader'),
use: [
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
minimize: true,
sourceMap: shouldUseSourceMap,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
{
loader: require.resolve('sass-loader'),
options: {
sourceMap: shouldUseSourceMap,
},
},
],
},
extractTextPluginOptions
)
),
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
// "file" loader makes sure assets end up in the `build` folder.
// When you `import` an asset, you get its filename.
// This loader don't uses a "test" so it will catch all modules
Expand Down
8 changes: 5 additions & 3 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "react-scripts-ts",
"name": "react-scripts-ts-ai",
"version": "2.7.0",
"description": "Configuration and scripts for Create React App.",
"repository": "wmonk/create-react-app",
"repository": "andersinno/create-react-app-ai",
"license": "BSD-3-Clause",
"engines": {
"node": ">=6"
},
"bugs": {
"url": "https://github.com/wmonk/create-react-app/issues"
"url": "https://github.com/andersinno/create-react-app-ai/issues"
},
"files": [
"bin",
Expand All @@ -31,11 +31,13 @@
"fs-extra": "3.0.1",
"html-webpack-plugin": "2.29.0",
"jest": "20.0.4",
"node-sass": "^4.5.3",
"object-assign": "4.1.1",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.6",
"promise": "8.0.1",
"react-dev-utils": "^4.0.1",
"sass-loader": "^6.0.6",
"style-loader": "0.18.2",
"ts-jest": "^20.0.7",
"ts-loader": "^2.2.1",
Expand Down