Skip to content

Commit 39eb512

Browse files
committed
merge
2 parents 929df28 + 0df0abb commit 39eb512

File tree

4 files changed

+82
-94
lines changed

4 files changed

+82
-94
lines changed

gulpfile.js

Lines changed: 0 additions & 88 deletions
This file was deleted.

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ bower install mojs-curve-editor
2929
Import `MojsCurveEditor` constructor to your code (depends on your environment) :
3030

3131
```javascript
32-
const MojsCurveEditor = require('mojs-player').default;
32+
const MojsCurveEditor = require('mojs-curve-editor').default;
3333
// or
34-
import MojsCurveEditor from 'mojs-player';
34+
import MojsCurveEditor from 'mojs-curve-editor';
3535
```
3636

3737
If you installed it with script link - you should have `MojsCurveEditor` global.

webpack.config.babel.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import webpack from 'webpack';
2+
import path from 'path';
3+
import autoprefixer from 'autoprefixer';
4+
import UnminifiedWebpackPlugin from 'unminified-webpack-plugin';
5+
6+
const LAUNCH_COMMAND = process.env.npm_lifecycle_event;
7+
const isProduction = LAUNCH_COMMAND === 'production';
8+
process.env.BABEL_ENV = LAUNCH_COMMAND
9+
10+
const base = {
11+
context: __dirname + '/',
12+
entry: [
13+
__dirname + '/app/js/app.babel.jsx'
14+
],
15+
module: {
16+
preLoaders: [
17+
{
18+
exclude: /src\//,
19+
loader: 'source-map'
20+
}
21+
],
22+
loaders: [
23+
{ test: /\.(json)$/, exclude: /node_modules/, loaders: ['json-loader'] },
24+
{ test: /\.(jsx|.js|babel.jsx|babel.js)$/,
25+
exclude: /node_modules/,
26+
loader: 'babel-loader'
27+
},
28+
{ test: /\.(postcss.css)$/, loader: 'style-loader!css-loader!postcss-loader' },
29+
{ test: /\.html$/, loader: 'raw-loader' },
30+
{
31+
test: /\.(eot|woff|ttf|svg|png|jpg|wav|mp3)$/,
32+
loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]',
33+
}
34+
]
35+
},
36+
postcss: function () {
37+
return {
38+
defaults: [ require('precss'), require('postcss-cssnext'), require('postcss-modules') ],
39+
cleaner: [autoprefixer({ browsers: ['last 2 versions'] })]
40+
};
41+
},
42+
output: {
43+
path: __dirname + '/app/build/',
44+
filename: 'mojs-curve-editor.min.js',
45+
publicPath: 'build/',
46+
library: 'mojs-curve-editor',
47+
libraryTarget: 'umd',
48+
umdNamedDefine: true,
49+
},
50+
plugins: [new UnminifiedWebpackPlugin()],
51+
resolve: {
52+
root: [ path.resolve('./') ],
53+
moduleDirectories: ['node_modules'],
54+
target: 'node',
55+
extensions: [
56+
'', '.js', '.babel.js', '.babel.jsx',
57+
'.postcss.css', '.css', '.json'
58+
]
59+
}
60+
};
61+
62+
const productionPlugin = new webpack.DefinePlugin({
63+
'process.env': {
64+
NODE_ENV: JSON.stringify('production')
65+
}
66+
})
67+
68+
const developmentConfig = {
69+
// devtool: 'inline-source-map'
70+
// watch: true,
71+
}
72+
73+
const productionConfig = {
74+
// devtool: 'source-map',
75+
plugins: [productionPlugin, new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}})]
76+
}
77+
78+
export default Object.assign({}, base, isProduction === true ? productionConfig : developmentConfig)

webpack.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,15 @@ module.exports = {
6060
// new webpack.NoErrorsPlugin(),
6161
// new webpack.optimize.DedupePlugin(),
6262
new webpack.optimize.UglifyJsPlugin({
63-
compress: {
64-
warnings: false
65-
}
63+
compress: { warnings: false }
6664
}),
6765
new UnminifiedWebpackPlugin()
6866
// new webpack.HotModuleReplacementPlugin()
6967
],
7068
// devtool: process.env.NODE_ENV==='production' ? 'source-map' : 'inline-source-map',
7169
resolve: {
7270
root: [ path.resolve('./') ],
73-
moduleDirectories: ['node_modules', 'vendor'],
71+
moduleDirectories: ['node_modules'],
7472
target: 'node',
7573
extensions: [
7674
'', '.js', '.babel.js', '.babel.jsx',

0 commit comments

Comments
 (0)