-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
109 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"*.{js,jsx,ts,tsx,md,html,css}": "prettier --write" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
import '@styles/styles.css'; | ||
/** | ||
* Created by: Andrey Polyakov ([email protected]) | ||
*/ | ||
import '@styles/styles.less'; | ||
import '@styles/styles.scss'; | ||
import "@styles/styles.css"; | ||
import "@styles/styles.less"; | ||
import "@styles/styles.scss"; | ||
|
||
import React from 'react'; | ||
import ReactDom from 'react-dom'; | ||
import { App } from "@components/app/app"; | ||
import React from "react"; | ||
import ReactDom from "react-dom"; | ||
|
||
import {App} from '@components/app/app'; | ||
|
||
ReactDom.render(<App />, document.getElementById('root')); | ||
ReactDom.render(<App />, document.getElementById("root")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import merge from "webpack-merge"; | ||
|
||
import baseConfig from "./webpack/base"; | ||
import devConfig from "./webpack/dev"; | ||
import prodConfig from "./webpack/prod"; | ||
import { isProd } from "./webpack/utils/env"; | ||
|
||
export default () => (isProd ? merge(baseConfig, prodConfig) : merge(baseConfig, devConfig)); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
/** | ||
* Created by: Andrey Polyakov ([email protected]) | ||
*/ | ||
import {join} from 'path'; | ||
import { join } from "path"; | ||
|
||
import MiniCssExtractPlugin from 'mini-css-extract-plugin'; | ||
import MiniCssExtractPlugin from "mini-css-extract-plugin"; | ||
|
||
import {sassResourceItems} from '../config'; | ||
import {isProd, rootDir, webpackDir} from '../utils/env'; | ||
import { sassResourceItems } from "../config"; | ||
import { isProd, rootDir, webpackDir } from "../utils/env"; | ||
|
||
export const cssLoader = { | ||
loader: 'css-loader', | ||
loader: "css-loader", | ||
}; | ||
|
||
/** | ||
* Sass loader with sass-resources-loader | ||
*/ | ||
export const sassLoaderItems = [ | ||
{ | ||
loader: 'sass-loader', | ||
{ | ||
loader: "sass-loader", | ||
options: { | ||
sourceMap: true, | ||
// Prefer `dart-sassRules` | ||
implementation: require("sass"), | ||
}, | ||
}, | ||
sassResourceItems.length | ||
? { | ||
loader: "sass-resources-loader", | ||
options: { | ||
sourceMap: true, | ||
// Prefer `dart-sassRules` | ||
implementation: require('sass'), | ||
resources: sassResourceItems, | ||
}, | ||
}, | ||
sassResourceItems.length | ||
? { | ||
loader: 'sass-resources-loader', | ||
options: { | ||
resources: sassResourceItems, | ||
}, | ||
} | ||
: null, | ||
} | ||
: null, | ||
]; | ||
|
||
export const postCssLoader = { | ||
loader: 'postcss-loader', | ||
options: { | ||
postcssOptions: { | ||
config: join(webpackDir, './config/postcss.js'), | ||
}, | ||
sourceMap: true, | ||
loader: "postcss-loader", | ||
options: { | ||
postcssOptions: { | ||
config: join(webpackDir, "./config/postcss.js"), | ||
}, | ||
sourceMap: true, | ||
}, | ||
}; | ||
|
||
/*** | ||
|
@@ -50,75 +50,74 @@ export const postCssLoader = { | |
* @see https://webpack.js.org/loaders/style-loader/#root | ||
*/ | ||
export const miniCssExtractLoader = isProd | ||
? { | ||
loader: MiniCssExtractPlugin.loader, | ||
options: { | ||
esModule: false, | ||
}, | ||
} | ||
: { | ||
loader: 'style-loader', | ||
options: { | ||
esModule: false, | ||
}, | ||
}; | ||
? { | ||
loader: MiniCssExtractPlugin.loader, | ||
options: { | ||
esModule: false, | ||
}, | ||
} | ||
: { | ||
loader: "style-loader", | ||
options: { | ||
esModule: false, | ||
}, | ||
}; | ||
|
||
/** | ||
* @see https://webpack.js.org/loaders/less-loader/#root | ||
*/ | ||
export const lessLoader = { | ||
loader: 'less-loader', | ||
options: { | ||
sourceMap: true, | ||
lessOptions: { | ||
javascriptEnabled: true, | ||
}, | ||
loader: "less-loader", | ||
options: { | ||
sourceMap: true, | ||
lessOptions: { | ||
javascriptEnabled: true, | ||
}, | ||
}, | ||
}; | ||
|
||
/** | ||
* Using to convert CSS modules from css-loader to TypeScript typings | ||
* @see https://github.com/TeamSupercell/typings-for-css-modules-loader | ||
*/ | ||
export const typingsCssModulesLoader = { | ||
loader: '@teamsupercell/typings-for-css-modules-loader', | ||
options: { | ||
banner: | ||
'// autogenerated by typings-for-css-modules-loader. \n// Please do not change this file!', | ||
formatter: 'prettier', | ||
}, | ||
loader: "@teamsupercell/typings-for-css-modules-loader", | ||
options: { | ||
banner: "// autogenerated by typings-for-css-modules-loader. \n// Please do not change this file!", | ||
formatter: "prettier", | ||
}, | ||
}; | ||
|
||
/** | ||
* @see https://webpack.js.org/loaders/sass-loader/#problems-with-url | ||
*/ | ||
export const resolveUrlLoader = { | ||
loader: 'resolve-url-loader', | ||
options: { | ||
sourceMap: true, | ||
}, | ||
loader: "resolve-url-loader", | ||
options: { | ||
sourceMap: true, | ||
}, | ||
}; | ||
|
||
export const babelLoader = { | ||
loader: 'babel-loader', | ||
options: { | ||
configFile: join(rootDir, '/.babelrc.js'), | ||
}, | ||
loader: "babel-loader", | ||
options: { | ||
configFile: join(rootDir, "/babel.config.js"), | ||
}, | ||
}; | ||
|
||
export const cssModulesSupportLoaderItems = [ | ||
miniCssExtractLoader, | ||
typingsCssModulesLoader, | ||
{ | ||
...cssLoader, | ||
options: { | ||
esModule: false, | ||
modules: { | ||
exportLocalsConvention: 'camelCaseOnly', | ||
localIdentName: '[local]__[contenthash:base64:5]', | ||
}, | ||
}, | ||
miniCssExtractLoader, | ||
typingsCssModulesLoader, | ||
{ | ||
...cssLoader, | ||
options: { | ||
esModule: false, | ||
modules: { | ||
exportLocalsConvention: "camelCaseOnly", | ||
localIdentName: "[local]__[contenthash:base64:5]", | ||
}, | ||
}, | ||
}, | ||
]; | ||
|
||
export const cssLoaderItems = [miniCssExtractLoader, cssLoader]; |