Skip to content

Commit 41262c0

Browse files
committed
fix(.gitignore): deconflict ignored files with published files
1 parent 9c1028c commit 41262c0

File tree

10 files changed

+102
-4
lines changed

10 files changed

+102
-4
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
/node_modules
33

44
# Production
5-
/**/*.js
6-
/**/*.js.map
5+
lib/**/*.js
76

87
# Misc
98
.DS_Store

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ react-layered-image is an interactive, multi-layer image component for
1414

1515
## License
1616

17-
react-layered-image is [MIT licensed](./LICENSE).
17+
[MIT](./LICENSE)

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ["@commitlint/config-conventional"],
3+
};

dist/index.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/src/index.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React from "react";
2+
import { render } from "react-dom";
3+
4+
import LayeredImage from "react-layered-image";
5+
6+
const rootDivStyle = {
7+
position: "absolute",
8+
top: 0,
9+
right: 0,
10+
bottom: 0,
11+
left: 0,
12+
display: "flex",
13+
justifyContent: "center",
14+
alignItems: "center",
15+
backgroundColor: "rgba(238, 239, 244, 1)",
16+
};
17+
18+
render(
19+
<div style={rootDivStyle}>
20+
<LayeredImage
21+
layers={["http://kloc.pm/images/back.png", "http://kloc.pm/images/front.png"]}
22+
aspectRatio={0.75}
23+
borderRadius={8}
24+
lightOpacity={0.15}
25+
shadowColor="#1f2933"
26+
/>
27+
</div>,
28+
document.getElementById("root"),
29+
);

lib/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// export { LayeredImage, ILayeredImageProps, ILayeredImageState } from "./LayeredImage";
21
import LayeredImage, { ILayeredImageProps, ILayeredImageState } from "./LayeredImage";
32

43
export { ILayeredImageProps, ILayeredImageState };

webpack.common.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const path = require("path");
2+
const CleanWebpackPlugin = require("clean-webpack-plugin");
3+
const CopyWebpackPlugin = require("copy-webpack-plugin");
4+
5+
module.exports = {
6+
entry: "./lib/index.ts",
7+
output: {
8+
path: path.resolve(__dirname, "dist"),
9+
filename: "index.js",
10+
library: "react-layered-image",
11+
libraryTarget: "umd",
12+
},
13+
resolve: {
14+
extensions: [".js", "jsx", ".ts", ".tsx"],
15+
},
16+
externals: {
17+
react: "react",
18+
},
19+
module: {
20+
rules: [
21+
{
22+
test: /\.tsx?$/,
23+
loader: "awesome-typescript-loader",
24+
exclude: /node_modules/,
25+
query: {
26+
declaration: false,
27+
},
28+
},
29+
],
30+
},
31+
plugins: [
32+
new CleanWebpackPlugin(["dist"]),
33+
new CopyWebpackPlugin([
34+
{
35+
from: "typings/LayeredImage.d.ts",
36+
to: "index.d.ts",
37+
},
38+
]),
39+
],
40+
};

webpack.dev.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const merge = require("webpack-merge");
2+
const common = require("./webpack.common.js");
3+
4+
module.exports = merge(common, {
5+
devtool: "inline-source-map",
6+
devServer: {
7+
contentBase: "./dist",
8+
},
9+
});

webpack.prod.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const webpack = require("webpack");
2+
const merge = require("webpack-merge");
3+
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
4+
const common = require("./webpack.common.js");
5+
6+
module.exports = merge(common, {
7+
devtool: "source-map",
8+
plugins: [
9+
new UglifyJSPlugin({
10+
sourceMap: true,
11+
}),
12+
new webpack.DefinePlugin({
13+
"process.env.NODE_ENV": JSON.stringify("production"),
14+
}),
15+
],
16+
});

0 commit comments

Comments
 (0)