Skylsmoi 6 anni fa
commit
1ec8a204a8
6 ha cambiato i file con 143 aggiunte e 0 eliminazioni
  1. 13 0
      .editorconfig
  2. 5 0
      .gitignore
  3. 1 0
      dist/tracimLib.js
  4. 47 0
      package.json
  5. 3 0
      src/index.js
  6. 74 0
      webpack.config.js

+ 13 - 0
.editorconfig Vedi File

@@ -0,0 +1,13 @@
1
+# doc here : https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
2
+root = true
3
+
4
+[*]
5
+indent_style = space
6
+indent_size = 2
7
+end_of_line = lf
8
+charset = utf-8
9
+insert_final_newline = true
10
+trim_trailing_whitespace = true
11
+
12
+[*.py]
13
+indent_size = 4

+ 5 - 0
.gitignore Vedi File

@@ -0,0 +1,5 @@
1
+# Created by .ignore support plugin (hsz.mobi)
2
+.idea/
3
+.git/
4
+node_modules/
5
+/dist/tracimLib.js

+ 1 - 0
dist/tracimLib.js Vedi File

@@ -0,0 +1 @@
1
+var tracimLib=function(e){function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var n={};return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="",r(r.s=0)}([function(e,r,n){"use strict";function t(){console.log("bonjour ?!")}Object.defineProperty(r,"__esModule",{value:!0}),r.bonjour=t}]);

+ 47 - 0
package.json Vedi File

@@ -0,0 +1,47 @@
1
+{
2
+  "name": "tracim_lib",
3
+  "version": "1.0.0",
4
+  "main": "dist/tracimLib",
5
+  "scripts": {
6
+    "mockapi": "node jsonserver/server.js",
7
+    "servdev": "NODE_ENV=development webpack-dev-server --watch --colors --inline --hot --progress",
8
+    "build": "NODE_ENV=production webpack -p",
9
+    "test": "echo \"Error: no test specified\" && exit 1"
10
+  },
11
+  "author": "",
12
+  "license": "ISC",
13
+  "dependencies": {
14
+    "babel-core": "^6.26.0",
15
+    "babel-eslint": "^8.2.1",
16
+    "babel-loader": "^7.1.2",
17
+    "babel-plugin-transform-class-properties": "^6.24.1",
18
+    "babel-plugin-transform-object-assign": "^6.22.0",
19
+    "babel-plugin-transform-object-rest-spread": "^6.26.0",
20
+    "babel-polyfill": "^6.26.0",
21
+    "babel-preset-env": "^1.6.1",
22
+    "babel-preset-react": "^6.24.1",
23
+    "classnames": "^2.2.5",
24
+    "css-loader": "^0.28.7",
25
+    "file-loader": "^1.1.5",
26
+    "prop-types": "^15.6.0",
27
+    "react": "^16.0.0",
28
+    "react-dom": "^16.0.0",
29
+    "standard": "^11.0.0",
30
+    "standard-loader": "^6.0.1",
31
+    "style-loader": "^0.19.0",
32
+    "stylus": "^0.54.5",
33
+    "stylus-loader": "^3.0.1",
34
+    "url-loader": "^0.6.2",
35
+    "webpack": "^3.8.1",
36
+    "whatwg-fetch": "^2.0.3"
37
+  },
38
+  "devDependencies": {
39
+    "webpack-dev-server": "^2.9.2"
40
+  },
41
+  "standard": {
42
+    "globals": [],
43
+    "parser": "babel-eslint",
44
+    "ignore": []
45
+  },
46
+  "description": ""
47
+}

+ 3 - 0
src/index.js Vedi File

@@ -0,0 +1,3 @@
1
+export function bonjour () {
2
+  console.log('bonjour ?!')
3
+}

+ 74 - 0
webpack.config.js Vedi File

@@ -0,0 +1,74 @@
1
+const webpack = require('webpack')
2
+const path = require('path')
3
+const isProduction = process.env.NODE_ENV === 'production'
4
+
5
+module.exports = {
6
+  entry: './src/index.js',
7
+  output: {
8
+    path: path.resolve(__dirname, 'dist'),
9
+    filename: 'tracimLib.js',
10
+    pathinfo: !isProduction,
11
+    library: 'tracimLib',
12
+    libraryTarget: 'var'
13
+  },
14
+  devServer: {
15
+    contentBase: path.join(__dirname, 'dist/'),
16
+    port: 8071,
17
+    hot: true,
18
+    noInfo: true,
19
+    overlay: {
20
+      warnings: false,
21
+      errors: true
22
+    },
23
+    historyApiFallback: true
24
+    // headers: {
25
+    //   'Access-Control-Allow-Origin': '*'
26
+    // }
27
+  },
28
+  devtool: isProduction ? false : 'cheap-module-source-map',
29
+  module: {
30
+    rules: [{
31
+      test: /\.jsx?$/,
32
+      enforce: 'pre',
33
+      use: 'standard-loader',
34
+      exclude: [/node_modules/]
35
+    }, {
36
+      test: [/\.js$/, /\.jsx$/],
37
+      loader: 'babel-loader',
38
+      options: {
39
+        presets: ['env', 'react'],
40
+        plugins: ['transform-object-rest-spread', 'transform-class-properties', 'transform-object-assign']
41
+      },
42
+      exclude: [/node_modules/]
43
+    }, {
44
+      test: /\.css$/,
45
+      use: ['style-loader', 'css-loader']
46
+    }, {
47
+      test: /\.styl$/,
48
+      use: ['style-loader', 'css-loader', 'stylus-loader']
49
+    }, {
50
+      test: /\.(jpg|png|svg)$/,
51
+      loader: 'url-loader',
52
+      options: {
53
+        limit: 25000
54
+      }
55
+    }]
56
+  },
57
+  resolve: {
58
+    extensions: ['.js', '.jsx']
59
+  },
60
+  plugins:[
61
+    ...[], // generic plugins always present
62
+    ...(isProduction
63
+      ? [ // production specific plugins
64
+        new webpack.DefinePlugin({
65
+          'process.env': { 'NODE_ENV': JSON.stringify('production') }
66
+        }),
67
+        new webpack.optimize.UglifyJsPlugin({
68
+          compress: { warnings: false }
69
+        })
70
+      ]
71
+      : [] // development specific plugins
72
+    )
73
+  ]
74
+}