ソースを参照

Merge branch 'master' of http://192.168.1.220:10080/lincl/custom-components-mobile

# Conflicts:
#	.gitignore
#	README.md
#	package-lock.json
#	package.json
#	src/App.vue
#	yarn.lock
lincl 4 年 前
コミット
2eacde258a
4 ファイル変更142 行追加0 行削除
  1. 6 0
      .babelrc
  2. 9 0
      .editorconfig
  3. 11 0
      index.html
  4. 116 0
      webpack.config.js

+ 6 - 0
.babelrc

@ -0,0 +1,6 @@
{
  "presets": [
    ["env", { "modules": false }],
    "stage-3"
  ]
}

+ 9 - 0
.editorconfig

@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

+ 11 - 0
index.html

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>custom-components</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="/dist/index.js"></script>
  </body>
</html>

+ 116 - 0
webpack.config.js

@ -0,0 +1,116 @@
var path = require('path')
var webpack = require('webpack')
function resolve(dir) {
  return path.join(__dirname, dir)
}
const NODE_ENV = process.env.NODE_ENV
module.exports = {
  entry: NODE_ENV=='development'? './src/main.js' : './index.js',
  output: {
    path: path.resolve(__dirname, './dist'),
    publicPath: '/dist/',
    filename: 'index.js'
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'vue-style-loader',
          'css-loader'
        ],
      },
      {
        test: /\.scss$/,
        use: [
          'vue-style-loader',
          'css-loader',
          'sass-loader'
        ],
      },
      {
        test: /\.sass$/,
        use: [
          'vue-style-loader',
          'css-loader',
          'sass-loader?indentedSyntax'
        ],
      },
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: {
          loaders: {
            // Since sass-loader (weirdly) has SCSS as its default parse mode, we map
            // the "scss" and "sass" values for the lang attribute to the right configs here.
            // other preprocessors should work out of the box, no loader config like this necessary.
            'scss': [
              'vue-style-loader',
              'css-loader',
              'sass-loader'
            ],
            'sass': [
              'vue-style-loader',
              'css-loader',
              'sass-loader?indentedSyntax'
            ]
          }
          // other vue-loader options go here
        }
      },
      {
        test: /\.js$/,
        loader: 'babel-loader',
        exclude: /node_modules/
      },
      {
        test: /\.(png|jpg|gif|svg)$/,
        loader: 'file-loader',
        options: {
          name: '[name].[ext]?[hash]'
        }
      },
      {
        test: /\.(eot|svg|ttf|woff|woff2)(\?\S*)?$/,
        loader: 'file-loader'
      }
    ]
  },
  resolve: {
    alias: {
      'vue$': 'vue/dist/vue.esm.js',
      '@': resolve('src')
    },
    extensions: ['*', '.js', '.vue', '.json']
  },
  devServer: {
    historyApiFallback: true,
    noInfo: true,
    overlay: true
  },
  performance: {
    hints: false
  },
  devtool: '#eval-source-map',
}
if (process.env.NODE_ENV === 'production') {
  module.exports.devtool = '#source-map'
  // http://vue-loader.vuejs.org/en/workflow/production.html
  module.exports.plugins = (module.exports.plugins || []).concat([
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: '"production"'
      }
    }),
    new webpack.optimize.UglifyJsPlugin({
      sourceMap: true,
      compress: {
        warnings: false
      }
    }),
    new webpack.LoaderOptionsPlugin({
      minimize: true
    })
  ])
}