質問編集履歴

2

追記

2018/04/05 01:32

投稿

cheche0830
cheche0830

スコア187

test CHANGED
File without changes
test CHANGED
@@ -257,3 +257,15 @@
257
257
  module.exports = settings;
258
258
 
259
259
  ```
260
+
261
+
262
+
263
+
264
+
265
+ 追記:
266
+
267
+ やはり、css-loaderでマッピングされたクラス名だと
268
+
269
+ jsが反応しないようなので、jquery-uiのcssファイルだけcss-loaderが
270
+
271
+ きかないように出来ないかという方向性で検討してみたいと思いますのでいったんこちらは閉じさせていただきます。

1

webpack設定ファイルを追記

2018/04/05 01:32

投稿

cheche0830
cheche0830

スコア187

test CHANGED
File without changes
test CHANGED
@@ -93,3 +93,167 @@
93
93
 
94
94
 
95
95
  こちらを改善するにはどのような手法が考えられますでしょうか?
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ //webpack設定ファイルを追記
104
+
105
+ ```ここに言語を入力
106
+
107
+ const path = require('path');
108
+
109
+ const webpack = require('webpack');
110
+
111
+
112
+
113
+ const settings = {
114
+
115
+ entry: {
116
+
117
+ test: [
118
+
119
+ "react-hot-loader/patch",
120
+
121
+ "./src/frontend/test.js"
122
+
123
+ ]
124
+
125
+ },
126
+
127
+ output: {
128
+
129
+ filename: "[name].js",
130
+
131
+ publicPath: "/",
132
+
133
+ path: path.resolve("build")
134
+
135
+ },
136
+
137
+ resolve: {
138
+
139
+ extensions: [".js", ".json", ".css"]
140
+
141
+ },
142
+
143
+ devtool: "eval-source-map",
144
+
145
+ module: {
146
+
147
+ rules: [
148
+
149
+ {
150
+
151
+ test: /.js?$/,
152
+
153
+ loader: 'babel-loader',
154
+
155
+ options: {
156
+
157
+ presets: [
158
+
159
+ ["es2015", { modules: false }],
160
+
161
+ "stage-2",
162
+
163
+ "react"
164
+
165
+ ],
166
+
167
+ plugins: [
168
+
169
+ "transform-node-env-inline"
170
+
171
+ ],
172
+
173
+ env: {
174
+
175
+ development: {
176
+
177
+ plugins: ["react-hot-loader/babel"]
178
+
179
+ }
180
+
181
+ }
182
+
183
+ }
184
+
185
+ },
186
+
187
+ {
188
+
189
+ test: /.css$/,
190
+
191
+ use: [
192
+
193
+ "style-loader",
194
+
195
+ {
196
+
197
+ loader: "css-loader",
198
+
199
+ options: {
200
+
201
+ modules: true,
202
+
203
+ sourceMap: true,
204
+
205
+ importLoaders: 1,
206
+
207
+ localIdentName: "[name]--[local]--[hash:base64:8]"
208
+
209
+ }
210
+
211
+ },
212
+
213
+ "postcss-loader" // has separate config, see postcss.config.js nearby
214
+
215
+ ]
216
+
217
+ },
218
+
219
+ ]
220
+
221
+ },
222
+
223
+ devServer: {
224
+
225
+ contentBase: path.resolve("src/www"),
226
+
227
+ publicPath: "http://localhost:3000/", // full URL is necessary for Hot Module Replacement if additional path will be added.
228
+
229
+ quiet: false,
230
+
231
+ hot: true,
232
+
233
+ historyApiFallback: true,
234
+
235
+ inline: true
236
+
237
+ },
238
+
239
+ plugins: [
240
+
241
+ new webpack.HotModuleReplacementPlugin(),
242
+
243
+ new webpack.NamedModulesPlugin(),
244
+
245
+ new webpack.LoaderOptionsPlugin({
246
+
247
+ debug: true
248
+
249
+ }),
250
+
251
+ ],
252
+
253
+ };
254
+
255
+
256
+
257
+ module.exports = settings;
258
+
259
+ ```