Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / webpack.config.js
1
2 /*
3 *
4 * Copyright 2016 RIFT.IO Inc
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19 /*
20 * Webpack development server configuration
21 *
22 * This file is set up for serving the webpack-dev-server, which will watch for changes and recompile as required if
23 * the subfolder /webpack-dev-server/ is visited. Visiting the root will not automatically reload.
24 */
25 'use strict';
26 var path = require('path');
27 var webpack = require('webpack');
28
29 module.exports = {
30
31 output: {
32 filename: 'main.js',
33 publicPath: '/assets/'
34 },
35
36 cache: true,
37 debug: true,
38 devtool: 'sourcemap',
39 entry: [
40 'webpack/hot/only-dev-server',
41 './src/components/ComposerApp.js'
42 ],
43
44 stats: {
45 colors: true,
46 reasons: true
47 },
48
49 module: {
50 preLoaders: [
51 {
52 test: /\.(js|jsx)$/,
53 exclude: /node_modules/,
54 loader: 'eslint-loader'
55 }
56 ],
57 loaders: [
58 {
59 test: /\.(js|jsx)$/,
60 exclude: /node_modules/,
61 loader: 'react-hot'
62 }, {
63 test: /\.(js|jsx)$/,
64 exclude: /node_modules/,
65 loader: 'babel-loader',
66 query: {
67 presets: ['react', 'es2015']
68 }
69 }, {
70 test: /\.scss/,
71 loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded'
72 }, {
73 test: /\.css$/,
74 loader: 'style-loader!css-loader'
75 }, {
76 test: /\.(jpg|woff|woff2|png)$/,
77 loader: 'url-loader'
78 }, {
79 test: /\.(svg)(\?[a-z0-9]+)?$/i,
80 loader: "file-loader"
81 }
82 ]
83 },
84 resolve: {
85 alias: {
86 'styles': path.join(process.cwd(), './src/styles/'),
87 'libraries': path.join(process.cwd(), './src/libraries/'),
88 'components': path.join(process.cwd(), './src/components/'),
89 //'stores': '../../../src/stores/',
90 //'actions': '../../../src/actions/',
91 'helpers': path.join(process.cwd(), './test/helpers/')
92 }
93 },
94
95 plugins: [
96 new webpack.HotModuleReplacementPlugin()
97 ]
98
99 };